"deleteMqttSession"
Use the "deleteMqttSession"
action to disconnect a client's MQTT session
The "deleteMqttSession"
action disconnects a client's MQTT session and permanently removes the client and its session information from the MQTT broker. This action is useful for deleting temporary client connections created during testing and troubleshooting and for resetting client sessions so that a device can resubscribe anew.
This action deletes the client record, removing all information about the client, including its subscriptions. The client may reconnect in the future to establish a new session.
The "clientName"
property uniquely identifies a client's session.
The action returns an error when a client does not exist or fails to be deleted.
Request example
{ "api": "mq", "action": "deleteMqttSession", "params": { "clientName": "a unique MQTT client identifier or empty string" }, "apiVersion": "1.0", "debug": "max", "requestId": "optionalUniqueRequestIdFromTheClient", "authToken": "replaceWithAuthTokenFromCreateSession" }
Use the "deleteMqttSession"
action to disconnect a client's MQTT session
Property | Description | Default | Type | Limits (inclusive) |
---|---|---|---|---|
specifies the unique name that identifies the client to the FairCom MQTT engine |
| string | 0 to 65,550 bytes |
The "clientName"
property is an optional string of up to 65550 characters containing a client name that uniquely identifies the client to the FairCom MQTT engine.
The MQTT protocol allows only one connection per client identifier because each connection is stateful. If another client with the same "clientName"
is already connected, the MQTT broker disconnects the other client and vice-versa.
The JSON MQ Message API behaves differently because it is stateless; it allows multiple processes to simultaneously use the same client identifier to manage sessions, subscribe to topics, send messages to topics, and retrieve messages from topics.