Reputation: 8068
When I'm trying out the websocket chat demo of ActiveMQ (http://localhost:8161/demo/websocket/) it seems that not all messages are transmitted between two different browser instances. For some reason only every 2nd message gets sent to one of the browsers.
Does anyone have an explanation for this? Is this something I need to configure?
Edit: Maybe I should add that I use stomp as wire protocol with the default setup (just changed the config file to use websockets).
Edit2: I couldn't find any difference in behaviour when following the example given at http://www.jmesnil.net/stomp-websocket/doc/. However, I noticed an interesting effect: When using 3 instances of clients, I could observe that the first message was received on the sending client, the 2nd message on the 2nd client (and not any of the others) and the 3rd message was received on the 3rd client. I would have thought that all clients receive the message at the same time.
Upvotes: 0
Views: 116
Reputation: 8068
I found out what's causing the problem: In the example I used, the clients subscribe to a queue, instead of a topic ('/queue/test'). Using a topic works as I expect (publish-subscribe pattern). I guess when it was using the queue the message was put into the queue by a client and picked up by any other client (and was immediately consumed).
Upvotes: 1