Developing REST applications with IBM MQ

We can develop REST applications to send and receive messages. IBM MQ supports different REST APIs depending upon platform and capability.

The IBM MQ supported options we can choose from to send messages to, and receive messages from, IBM MQ using REST are the following options:


IBM MQ messaging REST API

The messaging REST API comes as standard with IBM MQ from IBM MQ Version 9.0.4 and is enabled by default. We can use the messaging REST API to send and receive IBM MQ messages in plain text format.

Applications can issue an HTTP POST to send a message to IBM MQ, or an HTTP DELETE to destructively get a message from IBM MQ. Support is provided for a number of different HTTP headers which can be used to set common message properties.

The messaging REST API is fully integrated with IBM MQ security. Users must be authenticated to the mqweb server and must be a member of the MQWebUser role.

For further information, see Messaging using the REST API.


IBM MQ bridge for HTTP

The IBM MQ bridge for HTTP is a JEE application that can be installed into a suitable run time environment and provides a basic REST API on top of both the queues and topics hosted by a single MQ queue manager.

Applications can issue an HTTP POST to the bridge to send a message to IBM MQ, an HTTP GET to browse a message from IBM MQ, or an HTTP DELETE to destructively get a message from IBM MQ. Support is provided for a number of different HTTP headers which can be used to set message properties.

Note: From IBM MQ Version 8.0, the IBM MQ bridge for HTTP is deprecated. The IBM messaging REST API provided from IBM MQ Version 9.0.4 should be used as an alternative.

For further information, see Developing web services with IBM MQ bridge for HTTP.


IBM z/OS Connect EE

IBM z/OS Connect EE (zCEE) is a z/OS product that allows you to build REST APIs on top of existing z/OS assets such as CICS or IMS transactions, and IBM MQ queues and topics. The existing z/OS asset is hidden from the user. This allows you to REST enable your assets without changing them or any of the existing applications that use them.

With zCEE we can easily build up a REST API that will send and receive JSON data and optionally transform that data into the more traditional language structures expected by many mainframe applications. For example, COBOL copybooks.

An Eclipse based API editor can be used to build up a comprehensive RESTful API making use of query parameters and URL path segments, manipulating the JSON format as it flows through the zCEE runtime.

zCEE can be used to expose IBM MQ queues and topics as services. Two different service types are supported:

  • One way services: the function provided is similar to that provided with the IBM MQ bridge for HTTP where an HTTP POST sends a message, an HTTP DELETE destructively gets a message. The main benefits over the bridge is the built in data-conversion support and that we can use the API editor to build up a more comprehensive RESTful API.
  • Two way services: this provides a REST API on top of a pair of queues used by a back-end request-response style application. Callers issue an HTTP POST to the two-way service and send in JSON data. This data is put onto a request queue where it is processed by the back-end application and a response placed on the response queue. This response is retrieved and sent back to the caller as the POST response body.

zCEE is supported on IBM MQ Version 8 and later. For further information, see IBM MQ for z/OS Service Provider for z/OS Connect.


IBM Integration Bus

IBM Integration Bus is IBM's leading integration technology which can be used to connect applications and systems together regardless of the message formats and protocols that they support.

IBM Integration Bus has always supported IBM MQ and provides HTTPInput and HTTPRequest nodes which can be used to construct a RESTful interface on top of IBM MQ, and many other systems such as databases.

IBM Integration Bus can be used to do much more than provide a simple REST interface on top of IBM MQ. Its capabilities can be used to provide advanced payload manipulation, payload enrichment, and many other enhancements as part of a REST API.

For further information, see the technology sample which exposes a JSON over REST interface on top of an IBM MQ application that expects an XML payload.


DataPower

The DataPower gateway is a single multi-channel gateway which helps provide security, control, integration and optimized access to a range of systems, including IBM MQ. It comes in both hardware and virtual form factors.

One of the services that DataPower provides is a multi-protocol gateway which can take input in one protocol and generate output in a different protocol. In particular DataPower can be configured to accept HTTP(S) data and route it to IBM MQ over a client connection, which can be used to build a REST interface on top of IBM MQ. Other DataPower services such as transformation can also be used to enhance the REST interface.

For further information, see Multi-Protocol Gateway service.