Resolving problems if your MQTT client fails to connect
If your MQTT client cannot connect to a telemetry channel, there might be a number of reasons.
Procedure
Consider the following reasons to diagnose the problem with an MQTT client failing to connect:
- Check that the queue manager and telemetry (MQXR) service are running.
Start the queue manager. By default, the MQXR service should start with the queue manager. If you configured the MQXR service control to start manually, you might have to start the service from the Services folder. For more information about starting the MQXR service, see Start and stop the MQXR service.
- Check that the telemetry channel and telemetry (MQXR) service are defined and running correctly.
We can manually define the MQXR service and set the default transmit queue of the queue manager to SYSTEM.MQTT.TRANSMIT.QUEUE, which takes precedence over an existing default transmit queue. This makes the queue manager suitable for Telemetry. Alternatively, you might want to consider running the Define sample configuration wizard from the Telemetry welcome page, if you have not done so already.
- Have you written your own client?
If so, did you write your client application with the MQTT v3 protocol and not the v5 protocol? Try to isolate the problem by running the MQTT client utility.
- Do you have a valid client identifier name?
When connecting to IBM MQ, the MQTT client identifier should be less than 23 characters, and contain only alphabetic characters, numeric characters, and the period (.), forward slash (/), underscore (_), and percent sign (%).
- Did you connect your MQTT client and exhaust the MQTT keep alive interval?
The keep alive attribute is the interval in milliseconds after which, the MQTT client is disconnected due to inactivity. If the MQXR service does not receive any communication from the client within the keep alive interval, it disconnects from the client.
- Is a large number of MQTT clients trying to connect to a telemetry channel at the same time?
Every telemetry channel has a backlog attribute. This is the number of concurrent connection requests that the telemetry channel supports. Ensure that the value is not set to a number that is less than the number of MQTT clients trying to connect.
- Check that the TCP/IP connection is still active.
Parent topic: Troubleshooting MQ Telemetry using IBM MQ Explorer
Related tasks
Related reference