Open Navigation

IBM MQ

IBM MQ is robust, secure and reliable messaging middleware.

Overview

Authentication

To create an authentication with IBM MQ, click on the New Authentication button and enter the a username and API key generated through the IBM Cloud MQ Administrative page (if using IBM Cloud MQ). The host is also configurable and can be found in the configuration page of IBM MQ Cloud.

Please note only the host name is required, for example, if your REST endpoint was shown as this https://my-host-name/ibmmq/rest/v1..., only my-host-name is required.

Example 1 - Get message / Get and delete message

There are two operations on the IBM MQ connector that allow retrieval of messages, Get message and Get and delete message. Both operations are the same, however Get and delete message will also delete that message off of the queue.

Please note: the IBM MQ connector uses the REST API, which does not support once-and-once only delivery of messages with transactional control support.

To retrieve the next message on the queue, just specify a Queue manager name and Queue name. To retrieve a specific message, the Message ID or Correlation ID can be used.

Get message input

The output of the operation is an object which contains the actual message in the message property along with some metadata about the message.

If there are no messages left on the queue, or the message with the specified ID could not be found, the operation will fail. There is a found flag which can be referenced to indicate that all messages on the queue have been consumed/deleted (if not specifying an ID and using the Get and delete message operation).

Get message output

The Get and delete message operation has the additional input field wait, which delays the response from the IBM MQ API if there no more messages left on the queue. This potentially gives time for the next message to arrive in IBM MQ.

Example 2 - Send message

To send a message to a queue, specify the names of queue and it's manager. The message itself goes in the Message field.

Please choose the correct Content type of message, if none is chosen it will default to text/plain. Please note that character set/encoding is set to be charset=utf-8 by the connector.

Send message input

To use the Correlation ID field, please be aware that the value must be a 48 character long hexadecimal representation of a 24 byte string e.g. as seen in API docs, 414d5120514d4144455620202020202067d8bf5923582e02.

The output returns the Message ID of the created message on the queue.

Send message output

Example 3 - Create queue

Several types of queue can be created, including Local, Alias, Remote or Model. If creating Alias or Remote queues, please be aware that only a subset of the configuration options can be used.

For example, for Remote queues, the operation will only succeed if you do not send and incompatible values, please see below for an example of what the input should look like in the Debug view.

Create remote queue input

If there are additional unwanted input properties appearing, then please trying resetting those input fields so they are not sent to IBM MQ.

Was this article helpful?
Yes
No