有没有办法将redis连接成一个功能齐全的stompbroker?
根据redis文档,我们可以使用redis作为消息代理。我们计划使用redis作为聊天产品的消息代理。我正在尝试连接到redis,但失败了。有没有办法连接reids message broker for stomp?
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/chat");
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/app");
// registry.enableSimpleBroker("/topic");
registry.enableStompBrokerRelay("/topic").setRelayHost("localhost").setRelayPort(6379).setClientLogin("guest").setClientPasscode("guest");
}
}
当我尝试的时候,我得到了这个异常。io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException:没有枚举常量org.springframework.messaging.simp.stomp.StompCommand.-ERR未知命令CONNECT
,参数以:开头:
发布于 2019-12-19 16:51:42
您需要STOMP兼容的message broker。例如,STOMP Spring直接将每个RabbitMQ with stomp plugin命令传递给代理。没有办法将STOMP command转换为Redis Pub/Sub命令。
https://stackoverflow.com/questions/57658636
复制相似问题