Configuring the MQTT service with IBM WebSphere MQ Explorer

Follow these instructions to configure IBM® WebSphere® MQ using IBM WebSphere MQ Explorer to run the sample IBM WebSphere MQ Telemetry clients. The steps show you how to create an MQTT service by running the Define sample configuration wizard.

Before you begin

You must have administrative access to a IBM WebSphere MQ queue manager to set up the MQTT service. You have a number of ways to get access to a queue manager:
  1. Get a copy of IBM WebSphere MQ and create a queue manager on your own Linux® or Windows workstation. Follow the instructions in Installing IBM WebSphere MQ to obtain and install IBM WebSphere MQ. Note that you need to also select Telemetry Service and Telemetry Clients when installing. You can also modify an existing installation to add these options.
  2. Contact an IBM WebSphere MQ administrator and ask for administrative access to a queue manager on a server that has IBM WebSphere MQ Telemetry installed as an option. [V7.5.0.1 Mar 2013]In addition to the name of the queue manager, you require at least two TCP/IP ports for MQTT and for MQTT over WebSockets. If you are planning to connect secure clients, you require at least two more ports.
To do the steps in the task exactly as they are described, you must be able to create a queue manager called MQXR_SAMPLE_QM, and TCP/IP port 1883 must be unused.

About this task

In this task, you run the IBM WebSphere MQ Explorer Define sample configuration wizard to create a MQTT service to listen for MQTT V3.1 client connections on port 1883. The configuration gives everyone permission to publish and subscribe to any topic. The configuration of security and access control is minimal and is intended only for a queue manager that is on a secure network with restricted access. To run IBM WebSphere MQ and MQTT in an insecure environment, you must configure security. To configure security for IBM WebSphere MQ and MQTT, see the related links at the end of this task.

Procedure

  1. Log on with a user ID that has administrative authority to IBM WebSphere MQ.

    To define a user ID with administrative authority to IBM WebSphere MQ, see step 3 in Installing IBM WebSphere MQ.

  2. Open a command window, and run the IBM WebSphere MQ Explorer command strmqcfg to start IBM WebSphere MQ Explorer.
  3. Create a queue manager
    1. Start the New Queue Manager wizard
      Screen capture of IBM WebSphere MQ Explorer menu cascade to create a queue manager.
    2. Type a Queue manager name, and the name of the Dead-letter queue. For convenience, make it the default queue manager. Click Finish.
      Screen capture of queue manager properties window.

    IBM WebSphere MQ Explorer creates the queue manager and starts it.

  4. Run the Telemetry Define sample configuration wizard.
    1. Open the Telemetry folder for the queue manager.
      Screen capture of Welcome to IBM WebSphere MQ Telemetry
    2. Click Define sample configuration to start the wizard.
    3. Click Finish to create the telemetry service and run the MQTT Client Utility
      Screen capture of Define a sample configuration

Results

Open the Telemetry Channels folder to list the sample channels.
Screen capture of Telemetry Channels properties

You can modify the properties of this channel, and add and delete channels in this window.

What to do next

Test the connection by running the MQTT Client Utility.

  1. To start the client utility, open the Telemetry folder and click Run MQTT Client Utility twice.

    Two MQTT Client Utility windows open, identical but for different client identifiers.

    Screen capture of MQTT client utility
  2. Click Connect in both windows.
  3. Click Subscribe in both windows.
  4. Click Publish in either window. The results are shown in Figure 1
    Figure 1. Results
    Screen capture of two side by side MQTT client utility windows
  5. Click Disconnect in both windows.
The server is now ready for you to test your MQTT V3.1 app.