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 following options are the IBM MQ supported options we can choose from to send messages to, and receive messages from, IBM MQ:


IBM MQ messaging REST API

We can use the messaging REST API to send, receive, and browse IBM MQ messages in plain text format. The messaging REST API is enabled by default.

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. To use the messaging REST API, 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. See also Tutorial: Get started with the IBM MQ messaging REST API on IBM Developer, which includes Go and Node.js examples for using the messaging REST API.


IBM z/OS Connect EE

IBM z/OS Connect EE 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.

IBM z/OS Connect EE provides automatic data transformation to translate between the JSON data used by the REST APIs and the more traditional language structures, for example COBOL, expected by many mainframe applications.

The Eclipse based IBM z/OS Connect EE API toolkit 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 IBM z/OS Connect EE runtime.

IBM z/OS Connect EE can be used to expose IBM MQ queues and topics as RESTful APIs through the IBM MQ service provider. Two different service types are supported:

  • One-way services: these provide a REST API that allows a single IBM MQ operation to be performed on a queue or topic. Depending on the exact configuration an HTTP request can result in a message being sent to a queue or published to a topic; or an HTTP request can result in a message being destructively received from a queue
  • Two-way services: these provide a REST API on top of a pair of queues used by a back-end request-response style application. Callers issue an HTTP request to the two-way service. The HTTP request payload is transformed from JSON to a traditional language structure and 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 by the service, converted from the traditional language structure to JSON and sent back to the caller as the POST response body.

For more information on IBM z/OS Connect EE, see z/OS Connect EE Knowledge Center.

For more information on the IBM MQ service provider, see Use the IBM MQ service provider.


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.

  • Messaging using the REST API
    We can use the messaging REST API to perform simple point-to-point and publish messaging. We can publish messages to a topic, send messages to a queue, browse messages on a queue, and destructively get messages from a queue. Information is sent to, and received from, the messaging REST API in plain text format.