[z/OS][V9.0.1 Nov 2016]

Services

The MQ Service Provider exposes IBM® MQ queues and topics, and the applications that are behind them, as services. There are two types of services: one-way and two-way which are described in this section.

One-way service

A one-way service can be used to provide a RESTful API on top of a single IBM MQ queue or topic. RESTful clients can issue an HTTP POST with a JSON payload to a one-way service and the service takes the payload and sends a message, with the payload as the message body, to the target queue or topic.

Figure 1. One-way service
This image is described in the surrounding text.

One-way services also allow HTTP DELETE and HTTP GET requests to be issued against IBM MQ queues.

An HTTP DELETE results in a destructive get of an available message from the queue. An HTTP GET results in a browse of the first available message from the queue.
Note: Two HTTP GET calls return the same message, unless some other action has occurred, for example, an HTTP DELETE or message expiry, to remove the message from the queue.

The body of the message is returned to the RESTful client in the form of JSON. If the body of the message is not already in JSON format, for example a COBOL copybook, then z/OS® Connect can be configured to convert it to JSON, using a data transformation.

Two-way service

A two-way service allows a RESTful client to perform request-reply messaging against a pair of queues.

Figure 2. Two-way service
This image is described in the surrounding text.

The client issues an HTTP POST request specifying a JSON payload. The service takes the payload, optionally converts it to a different format such as a COBOL copybook, and sends it as a message to a request queue.

A backend application consumes the message, processes it and generates a response which is placed on a reply queue. The service locates this message, takes its payload, optionally converts it to JSON and returns it as the response body of the HTTP POST.