Recently I had read an iot article http://www.eclipse.org/community/eclipse_newsletter/2014/february/article2.php In this he is saying that, by mqtt protocol clients can communicate both in one to many and many to one ways. In the mqtt spec itself mentioning about the one to many but I had little confusion in many to one. What I understood is, many clients are publishing on same topic and there is only one subscriber for these different publishers.Then how the subscriber(user) should identify message belongs to which publisher? Another doubt, if two publishers used the same topic to publish their data without knowing each other, because of every client is connected to the internet, the subscriber will get both the datas. But that is not what the subscriber expected.He wants data from only one publisher. Is there any chance to occur the same scenario in mqtt communication?
MQTT is a publish and subscribe protocol with no direct connection between clients. However many applications require a client to client type connection.
Introduction: Using the MQTT (Message Queuing Telemetry Transport) broker, the user should be able to create an MQTT connection using one-way authentication (only MQTT server authenticates via the certificate).
Each one will handle 10-20 clients. As far as I understand a common solution is MQTT. The clients periodically send data to the broker (i.e. Mosquitto running on the hosting server), that in turn updates the main web app that runs on the same server.
Subscribing to Multiple MQTT Topics You can subscribe by: Calling the subscribe function for each topic. Calling the subscribe function with a topic list.
Here are some facts about MQTT that will perhaps help you understand.
A publisher does not "own" a topic. A publisher may choose to publish a message to ANY topic (assuming it is a valid MQTT topic).
Given point 1 above, any number of publishers may simultaneously publish to the same topic.
Hopefully these tidbits of information will help you understand, please let me know if I anything is still unclear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With