之前用stomp发送消息至后台怎么也发不到后台对应的MessageMapping,
发送代码如下
stomp.send("/app/test",{},JSON.stringify({"message":message})); 结果发现后台websocket的在学习配置的时候
注解前后端推送那个前缀写反了,纠正过来以后仍然发送不到后台,找了两天结果。。。我终于发现原因了,因为配置了多个前缀。。。所以本来我是那么写的`
registry.setApplicationDestinationPrefixes("/app,/api")
结果我点进去方法一看public MessageBrokerRegistry setApplicationDestinationPrefixes(String... prefixes) { this.applicationDestinationPrefixes = prefixes; return this; }
这要传的是多个String,不是用逗号拼接的字符串啊