shared subscription

58 views
Skip to first unread message

Jaimon Jose

unread,
Jul 19, 2020, 1:45:39 AM7/19/20
to rabbitmq-users
Hello,
I'm trying to switch one of our applications from another MQTT implementation to RabbitMQ with MQTT adapter.   One feature we use heavily is the shared subscriptions available in MQTTv5 where I can subscribe to topics from different nodes ($share/<group>/topic) and messages will be delivered to each node in the group in a roundrobin way.  I don't see any reference to shared subscription in RabbitMQ doc and the last reference in this group is from 2018.  Is there a way I can achieve same using RabbitMQ?  
Appreciate your help. 

Wesley

unread,
Jul 19, 2020, 1:59:11 AM7/19/20
to rabbitm...@googlegroups.com
Hi
If I have understand you correctly, you can have multiple subscribers
consuming to the same queue, the messages will be delivered to all
subscribers by round robin.

Regards.

Jaimon Jose

unread,
Jul 19, 2020, 8:42:01 AM7/19/20
to rabbitmq-users
Thank you.  I was expecting (like other implementations) the same messages to be delivered to all subscribers of a given topic.  If messages are delivered to multiple subscribers of a given topic by round robin, how do I implement a model where I expect all subscribers to receive same message?  

Jaimon Jose

unread,
Jul 19, 2020, 9:22:30 AM7/19/20
to rabbitmq-users
I tested this scenario.  If two clients are subscribed to topic1/+/+, both are receiving all messages sent to topic1/*.  So, that's working as expected.  How do I subscribe if I want these two subscribers to receive messages in roundrobin? (we use this when subscribers are clustered as we expect only one of them to receive a given message. We use $share/<group>/ prefix for the topic to achieve this.)

Warren Pang

unread,
Jul 19, 2020, 9:41:02 AM7/19/20
to rabbitm...@googlegroups.com
Hello

All consumers get the same messages, for this purpose you can declare the fanout exchange. All queues bonded to fanout exchange will get the same copy of a message.

Thanks 

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/a2c65ffd-06cb-4ded-957c-016b8ea5c195n%40googlegroups.com.

Jaimon Jose

unread,
Jul 19, 2020, 11:20:12 AM7/19/20
to rabbitmq-users
I'm not clear about the suggestion of using fanout exchange. Could you elaborate on that? The context is shared subscription where the messages are delivered to subscribers in round robin.   in a shared subscription model, each message will be delivered to one of the subscribers if there are two subscribers for a topic. I'm trying to find out how to achieve this using rabbitmq+mqtt plugin.    

I do understand that all subscribers of a given topic will get all messages in normal case.  I verified that already.

Reply all
Reply to author
Forward
0 new messages