MQTT: What is the general practice adopted in big scale application?

98 views
Skip to first unread message

manish kumar

unread,
Sep 17, 2016, 5:49:19 AM9/17/16
to MQTT

Is there any limitation on how many topic can be subscribed by a client ? I am using Paho js & java client. My use case is i want to inform every user about a new comment posted for a post.

I have two solution:

  1. every time a user post a comment subscribe to that post topic
  2. every time a user post a comment, iterate through each user and send message to all user specific topic

which one is will be better for large scale realtime application? What is the general practice adopted in big scale application ?

Dominik Obermaier

unread,
Sep 17, 2016, 7:26:11 AM9/17/16
to mq...@googlegroups.com, manish kumar
Hi Manish,

in general there is no limit for the number of client subscriptions defined in MQTT. A single SUBSCRIBE message can have as many subscriptions as you want (as long as you don’t exceed the MQTT max payload limit).

Bear mind, that not all brokers handle tens of thousands of subscriptions per client gracefully. We have experience with deployments with multiple tens of thousands of subscriptions per clients with a vast number of MQTT sessions. If you have multiple tens of millions of MQTT subscriptions in the system, you may need a scale-out approach which would require a cluster.

So as long as your broker supports it, I would go with option 1.

Hope this helps,
Dominik
--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

manish kumar

unread,
Sep 17, 2016, 10:42:54 AM9/17/16
to MQTT, mkj.o...@gmail.com
I am using RabbitMQ. So do you have any expeience for using RabbtMQ with 1000's topic subscription/client. Which broker you have tested with 1000's of topic subscription/client??

Dominik Obermaier

unread,
Sep 17, 2016, 12:05:26 PM9/17/16
to mq...@googlegroups.com, manish kumar
Hi Manish,

I don’t have experience with RabbitMQ and huge numbers of subscriptions. The broker we use is our own HiveMQ broker.

You may need to check with your vendor to see if there are limits for MQTT subscriptions.

All the best,
Dominik
Reply all
Reply to author
Forward
0 new messages