springboot websocket 使用rabbitmq 作为broker问题
springboot 项目,使用本地rabbitmq 作为broker:
// rabbitmq代理中继配置
config.enableStompBrokerRelay("/topic", "/queue")
.setRelayHost("localhost")
.setRelayPort(61613)
//.setVirtualHost("/local")
.setClientLogin("guest")
.setClientPasscode("guest");
前段开启链接时候会报错:
17-03-13 13:56:50.460 ERROR 24682 --- [eactor-tcp-io-3] o.s.m.s.s.StompBrokerRelayMessageHandler : Received ERROR {message=[Invalid destination], content-type=[text/plain], version=[1.0,1.1,1.2], content-length=[47]} session=hrgmdkgj text/plain payload='/campaign/1' is not a valid topic destination
大概是说我js subscribe 的地址/campaign/1有问题。
而如果不使用rabbitmq则没有该问题:
config.enableSimpleBroker("/topic", "/queue");
请问如果在spring websocket 下使用rabbitmq 作为stomp代理?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请问您可以把websocket的详细配置以及配置说明贴出来吗
rabbitmq作为消息中介 对目的地前缀有要求,不能随意设置目的地前缀
问题解决了吗、甩锅
nobody knows?