Configure External Broker(RabbitMQ) In Spring4+STOMP+SockJS Application

依然范特西╮ 提交于 2019-12-04 05:32:08

After doing some research and some experiments, as expected, I found out that the problem is on the client side. Changing

stompClient.connect({},  function(frame) {
    // subscribe to topics or queues and other stuff
});

to

stompClient.connect('guest', 'guest',  function(frame) {
    // subscribe to topics or queues and other stuff
});

worked like a charm. Here, first argument guest is the username and second argument guest is the password of the RabbitMQ server. So the basic point here is that whenever you configure an external broker you need to pass the username and password of the server. In case of simple broker, no need of passing credentials. Cheers!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!