jnovack / nut-to-mqtt

Network UPS Tools to MQTT exporter.
MIT License
9 stars 1 forks source link

ClientID not sufficiently random #2

Open jnovack opened 4 years ago

jnovack commented 4 years ago

Had two containers on swarm with the same client id (which MQTT does not like).

https://github.com/jnovack/nut-to-mqtt/blob/f9b9a37eb3ce711561f2f8e1c69f161f45c3dd2e/pkg/mqtt_publisher/mqtt_publisher.go#L46

References:

dustin commented 1 year ago

If you're not planning to reuse the client ID, then you just don't need to supply one and allow the broker to generate one for you. If you're using mqtt v5, it'll tell you what it generated in case you want to resume a session.