Mqqt client master

I am developing mobile app for mqtt client and my requirements are as below:
1)First client to connect will be the master and will receive the CFG topic.
2) No other client connecting later will receive the msg on CFG topic. In the app the config window will be disabled
3) If the first client reconnects after disconnecting it should be still be the master receiving the CFG topic

Could anyone here please enlighten me ?

Hi @latheefth

Thanks for your message. What can we “enlighten” you with? Do you have trouble implementing, what you have described?

Dasha from HiveMQ team

How do I implement it?

You asked how do you implement this:

In MQTT universe this translates into the following:

  1. first client connects with cliendID=“master” and “cleanStart=false” and subscribes to the topic=“CFG” – this creates a persistent session between the client and the broker;
  2. no other client subscribes to the topic=“CFG”
  3. If the first client reconnects after disconnecting, it still has persistent session with the broker and will be still subscribed to “CFG” and receiving messages published to the topic, if there are any.

Let me know if this is what you are looking for.
Dasha from HiveMQ team