Closed zxkane closed 7 years ago
Please post questions to rabbitmq-users or Stack Overflow. RabbitMQ uses GitHub issues for specific actionable items engineers can work on, not questions. Thank you.
Your understanding is correct. With the 2 clients listening on the same topic, you should see 2 queues in the management UI, bound with the routing key to the amq.topic
exchange. Each queues should receive a copy of the message. Please post your question on rabbitmq-users with versions and code samples, it'll help digging further.
We will update the language on that page but it's not really a good idea to describe topic routing (in STOMP or any other protocol) as "delivers a copy of each message to all active subscribers". That's a pretty precise definition of fanouting, not topic-based routing.
According to the doc of stomp, the message with destination from /topic/ will be delivered to all active subscribers.
But the behavior in my application is NOT consistent with above declaration.
I have an app that uses spring-websocket over stomp protocol, and uses RabbitMQ(3.6.6) with stomp as full feature broker.
Once the app receives a message from user, it will send the message to destination
/topic/<route-key>
. In my test scenario I opened two browers to open the same page. There are two clients to subscribe the same/topic/<route-key>
. After the server side app sends the message to destination/topic/<route-key>
, only one client receives the message. If more messages are sent by my app, the two clients will rotate to receive messages.If using
SimpleBroker
ofspring-websocket
which is a memory broker implementation instead of RabbitMQ, both of two clients can receive the same message.Is there any misunderstanding of stomp specification? If not, how I can debug this problem in RabbitMQ? If you need more information please let me know.