mosquitto-users team mailing list archive
-
mosquitto-users team
-
Mailing list archive
-
Message #00011
Re: Getting the client ID of messages received
The client ID was probably introduced to implement access control. So and
so client ID cannot publish/subscribe to such topics, etc. Or, is allowed
to publish/subscribe only if id and password authentication went
successful, etc.
At least, in mosquitto, there is a -I switch that generates a client ID
with the provided value as the prefix to the process ID running the
command. This can, to an extent, ensure uniqueness.
Suppose, you are monitoring the soil pH of various potted plants. The
monitoring device has a client ID based on the potted plant which you would
have designated in your own convenient way. That convenient way would also
ensure some uniqueness just as you were taking readings off a scientific
experiment.
In other words, there isn't anything automatic to ensure uniqueness of
client ID; the onus is probably on the 'users' of the system.
Follow ups
References