We have a number of new features to talk to you about that are all part of the MQ REST API in V9.0.4. I’m here to talk to you about just one of them, subscriptions.


If you’ve been following these blogs posts you’ll have no doubt heard that in MQ V9.0.1 we introduced a REST API. It gives you a really quick and modern way of issuing administrative actions to MQ by using HTTP requests. Over the last several releases we’ve continued to extend this API, expanding it to support more MQ objects. We’ve added APIs for queue managers, queues, channels and even runmqsc support. In V9.0.4, GET support for subscriptions was added to this list; you can issue a request and the REST API now will process it and return a list of subscriptions to you.

How do I use the subscriptions REST API?

Below is an example REST API request querying the list of subscriptions available on my test queue manager along with the response.
GET http://localhost:9080/ibmmq/rest/v1/admin/qmgr/RESTQM1/subscription

{"subscription": [
      "id": "414D512052455354514D3120202020204C7BDF5913EF1406",
      "name": "SYSTEM.DEFAULT.SUB",
      "resolvedTopicString": ""
      "id": "414D512052455354514D312020202020517BDF5920803E07",
      "name": "RESTQM1 SYSTEM.BROKER.INTER.BROKER.COMMUNICATIONS 414D51590101000000000000000000000000000000000000 SYSTEM.BROKER.ADMIN.STREAM MQ/RESTQM1 /StreamSupport",
      "resolvedTopicString": "SYSTEM.BROKER.ADMIN.STREAM/MQ/RESTQM1 /StreamSupport"

In addition to a basic request, we support all the usual parameters we’ve been adding to our other REST APIs such as limiting the list of attributes returned to a subset you care about or applying a number of filters against the dataset to only show the subscriptions that match your criteria.

For example, the following request will display the extended attributes on subscriptions that are against the topic ‘sports’


More information

There’s more information on the Subscriptions REST API in the MQ Knowledge Center.

2 comments on"Bitesize Blogging: View your subscriptions with the MQ REST API"

  1. The other objects that have REST APIs allow an HTML query string of status=*. How come subscriptions don’t?

Join The Discussion

Your email address will not be published.