2
votes

I have been researching MQTT and I am curious how implementation works when trying to create a one-to-one communication system.

What I am trying to do: Set up a system that allows a IOT device to push notifications directly to its user & the user to push notifications to their IOT device via a MQTT broker.

Thoughts on implementation:

  1. All devices have a separate topic that each user is subscribed to.
  2. Each device publishes to the same topic with a tag that identifies the user to pass the message to.

Below is an image I created of how I see the implementation working.

More Info: I need an system that can scale to include 100k+ devices, but extremely low amount of messages(1 message a day)

Layout:

  • IOT device will send message via MQTT to the back end system.
  • Back-end system will receive the message and store it in the back end.
  • Web-service(Dispatcher) layer which will communicate between the back-end and mobile application.
  • Mobile application will communicate directly to IOT device via web services.

Questions:

  • How is the MQTT Broker implemented with regard to topics for one-to-one communication when large amounts of users are anticipated?
  • Is there a limit on topics?
  • What am I missing regarding the layout?
1

1 Answers

1
votes

I think your concept of understanding MQTT (pub/sub messaging) is incorrect. Every client subscribed to a particular topic gets message. The "tag" you have mentioned (with a tag that identifies the user to pass the message to) is the topic name where the message has to be published.

If you want to do some special message distribution you have to create a client who will be subscribed to a topic where each client sends a message to and then it dispatches the message to particular “client” topic based on value of your “tag”.