Deploy MQTT Connector Apps in a Cluster

MQTT broker establishes a connection with a client using its client ID. For example, if the broker establishes a connection with a client whose client ID is smart-bentley-123, and then the broker receives a new connection with the same client ID, the broker closes the previous connection (assuming it is stale) and accepts the new connection. This mechanism is known as a client takeover. MQTT brokers employ this mechanism to prevent situations such as TCP connections reaching a half-open or invalid state due to a crash in one of the communication ends, which is undesirable.

Because of client takeover, Mule runtime engine (Mule) applications that use MQTT Connector deployed in a cluster must include a unique client ID for each active node in the cluster. To avoid client takeovers in this kind of scenario, you can supply these unique IDs either by using the application-provided client ID generators or by providing your own client ID generator.