Search code examples
javaapiwebsphereibm-mq

Getting all queue names of a queue manager


I am using Java API for WMQ.

I have seen that RFHUTIL is able to load all queue names in a drop down list for a queue manager.

Same way, I wanted to get all queue names for a queue manager in a list.

It is being done by RFHUTIL, so definitely it is possible. I checked the functions available for MQQueueManager class but could find any solution.

Need some advice.


Solution

  • Listing queue names in a queue manager is an administrative job. You have to use Programmable Command Format (PCF) classes to do that. There are number of PCF commands to create, delete, list queue, channels, etc. This link describes PCF in detail.

    For listing queues you can use MQCMD_INQUIRE_Q or MQCMD_INQUIRE_Q_NAMES PCF command. There are samples shipped with MQ. There is PCF_DisplayActiveLocalQueues.java is a useful one for you.