Subscribe to #
#1556
Replies: 1 comment
-
Subscribing to # is basically the easy way but clients will also receive the messages they send (when NoLocal is not used). Also, the traffic can get very high when "everything" is sent to "everyone". You can create as many clients in your application as you want or need. The only important thing is that you should make sure that every client has its own client ID when they are connected to the same broker. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our code base we have x number of subscribers of different topics and we want to have the Mqtt client as a singleton. Hence all subscribers should either communicate their topics to this singleton or we let the singleton just subscribe to everything (#) and then dispatch the messages to the the right subscribers in-process.
I feel that the latter approach is simpler. I have however read that subscibing to # is not encouraged. Why?
And is it recommended that the Mqtt client is a singleton or does it not matter?
Beta Was this translation helpful? Give feedback.
All reactions