Search code examples
javaibm-mqpcf

In IBM MQ (Java) how do I access all the queues under a given Queue Manager preferably using PCF?


I am working with developing a platform for enabling a user for adding stubs to a repo. The stubs use IBM MQ for message queuing. I need to provide the facility to display all the queues under a given queue manager namely say "MQSQ16X0" so that the user gets to choose the queue.

I tried following this link - Get ClusterName of MQ Queue using Java but this wasn't of help.


Solution

  • Use the Admin REST API -

    GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue

    Retrieves details of all queues that are defined in the named queue manager, optionally specifying which queue attributes are retrieved.

    Unfortunately you need a MQ server to access the swagger page. Its easier if you create an instance in the cloud. Then the url for the swagger page will be

    https://host:port/ibm/api/explorer

    There is a tutorial that guides you through using the REST API - https://developer.ibm.com/messaging/learn-mq/mq-tutorials/ibm-mq-messaging-rest-api/