My understanding from a previous post is that setting the "clean" parameter to false in MQTT has the same effect as subscribing to a topic in JMS. That is, the message will be kept until all subscribers have received the message.

My question is, what if a subscriber/listener is on a PC that has crashed? When the PC is restarted and the listener process starts again, how does MQTT recognize that it is the same client? It seems there should be some kind of identifier in addition to the clean=false parameter.

In the Telegraf MQTT, I guess this must be the client-id, which must not be empty if the "persistent-session" is set to true. Does this sound right?

1

There are 1 best solutions below

0
On BEST ANSWER

In order for persistent sessions to work, clients must reconnect with the same clientId (this is the whole point of the MQTT clientId)