Developing AMQP client applications

The IBM MQ support for AMQP APIs, including the MQ Light API, allows an IBM MQ administrator to create an AMQP channel. When it is started, this channel defines a port number that accepts connections from AMQP client applications.

We can install an AMQP channel on UNIX, Linux , or Windows; it is not available on IBM i or z/OS®.

The MQ Light API is based on the Oasis AMQP 1.0 protocol. There are messaging APIs for Node.js, Java™, Ruby and Python.

An application that is developed to use the MQ Light API can be connected to either an MQ Light runtime, an IBM MQ queue manager with an AMQP channel, or an instance of an MQ Light service in IBM Cloud (formerly Bluemix®).


Developing AMQP clients

The MQ Light API aims to make it easier to prototype and develop business applications rapidly. There are MQ Light APIs for Node.js, Java, Ruby and Python, available at https://github.com/mqlight.


Downloading sample AMQP clients

IBM MQ does not ship MQ Light clients, but we can download and install the following MQ Light clients:

    Node.js
    Install MQ Light Node.js API to your working directory using npm: npm install mqlight@1.0

    Java
    Download the mqlight-distribution package for the required version from Maven Central and extract the contents. We can find the available versions of the mqlight-distribution packages on Maven Central.

    Ruby
    Install MQ Light Ruby API to your working directory using gem: gem install mqlight --pre

    Python
    Install MQ Light Python API to your working directory using pip: pip install mqlight --pre

The MQ Light client downloads all include several samples, which demonstrate the different messaging features:

  • Send sample
  • Receive sample
  • UI Workout sample

We can also download other open-source AMQP clients based on Apache Qpid libraries, For more information, see https://qpid.apache.org/index.html


Securing AMQP clients

For information about securing MQ Light applications, see Securing AMQP clients.


Deploying AMQP clients to IBM MQ

When an application is ready to deploy, it requires all of the monitoring, reliability, and security capabilities of other enterprise applications. It can also exchange data with other enterprise applications. We can deploy MQ Light applications to an IBM MQ queue manager. See Deploying MQ Light applications to an on-premises IBM MQ environment or Deploying MQ Light applications to a stand-alone runtime and to IBM Cloud.

When we have deployed an AMQP client, we can exchange messages with IBM MQ applications. For example, if we use the MQ Light Node.js client to send a JavaScript string message, the IBM MQ application receives an MQ message, where the format field of the MQMD is set to MQSTR.


Managing the AMQP channel

The AMQP channel can be managed in the same way as other MQ channels. We can use MQSC commands, PCF command messages, or IBM MQ Explorer to define, start, stop, and manage the channels. In Creating and using AMQP channels, example commands are provided to define and start connecting clients to a queue manager.

When an AMQP channel is started, we can be test it by connecting an MQ Light application, by using any of the following methods:

  • Use the IBM MQ Light client for Node.js and Java.
  • Use the IBM MQ Light client for Ruby and Python.
  • Use another AMQP Version 1.0 client. For example, Apache Qpid Proton.