moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 509 forks source link

Unique identifier for clients? #519

Closed afrozl closed 8 years ago

afrozl commented 8 years ago

I am using collectd to forward messages to mosca. The client id set by collectd defaults to the hostname or can be manually set. Is there a unique identifier that mosca server assigns to each connection? I need this to ensure that clients don't end up stepping on each other. There is always the possibility that 2 clients/hosts might have the same name...

If each connection has a unique identifier, I can prepend that to the topic to endure that no collisions occur.

mcollina commented 8 years ago

If you don't specify an id, Mosca will automatically generate one for you. However, this will be private. Either you generate a unique id on the collectd side, or you allow multiple instances to publish on the same topic.

afrozl commented 8 years ago

thanks - I'll create a unique id/identifier on the client.