MQTT clients
An MQTT client app is responsible for collecting information from the telemetry device, connecting to the server, and publishing the information to the server. It can also subscribe to topics, receive publications, and control the telemetry device.
Unlike IBM MQ client applications, MQTT client apps are not IBM MQ applications. They do not specify a queue manager to connect to. They are not limited to using specific IBM MQ programming interfaces. Instead, MQTT clients implement the MQTT Version 3 protocol. We can write your own client library to interface to the MQTT protocol in the programming language, and on the platform, of our choice. See IBM MQ Telemetry Transport format and protocol.
To simplify writing MQTT client apps, use the C, Java, and JavaScript client libraries that encapsulate the MQTT protocol for a number of platforms. For links to client API documentation for the MQTT client libraries, see MQTT client programming reference. If you incorporate these libraries in your MQTT apps, a fully functional MQTT client can be as short as 15 lines of code.
To use the telemetry MQTT clients, download MA9C: IBM Messaging Telemetry Clients, then install the clients in a directory of our own choosing. The sample applications and client libraries are in client-specific directories under CLIENTPACKDIR/SDK/clients, where CLIENTPACKDIR is the directory in which you decompressed the client pack. Note that the example scripts included in IBM MQ assume that the clients are in the directories specified in Location of telemetry logs, error logs, and configuration files.
The MQTT client app is always responsible for initiating a connection with a telemetry channel. After it is connected, either the MQTT client app or an IBM MQ application can start an exchange of messages.
MQTT client apps and IBM MQ applications publish and subscribe to the same set of topics. An IBM MQ application can also send a message directly to an MQTT client app without the client app first creating a subscription. See Configure distributed queuing to send messages to MQTT clients.
MQTT client apps are connected to IBM MQ using a telemetry channel. The telemetry channel acts as a bridge between the different types of message used by MQTT and IBM MQ. It creates publications and subscriptions in the queue manager on behalf of the MQTT client app. The telemetry channel sends publications that match the subscriptions of an MQTT client app from the queue manager to the MQTT client app.
Parent topic: MQ Telemetry overview