0
votes

I have been trying to find all the queue managers inside IBM MQ Server by giving server details without queue manager name.

The idea is :

  • I have a properties file having server details- host, port number, channel, userid, passwrd.
  • By using this info we need to connect to the server and find all the queue managers available in the server.
  • I need to use IBM MQ classes in java.

As we have ways to find all the queues inside a queue manager can we do similarly to find all queue managers?

1
Each queue name will have its own listener and will not know about other queue managers. You could look at the webui and possibly REST interface, this is one per server and can see all queue managers. - JoshMc
@Thirumal Reddy your server could host more than one installation of IBM MQ and each installation could be at different versions. An installation can underpin one or more queue managers and, as JoshMc says, each QM could have listeners defined. This doc provides an overview of the basic MQ concepts and objects to help get you started. Are you trying to discover the queue managers defined on the host or just connect to a known list? The port number will likely be specific to a queue manager. - richc
@richc I am trying to find the queue managers defined on the host and based on the result, I need to find the queues in each of these QMs. - Thirumal Reddy
@Thirumal Reddy Have you taken a look at the dspmqinst command documented here? If you have a multi-version install, this will show the IBM MQ installations on the server. Depending on the result, it should be possible to set your env and follow the approach from Mark's answer to list the Queue Managers for each install. You could run some MQSC to show the listeners for each queue manager e.g., runmqsc QM1 then DISPLAY LISTENER(*) to show all listeners and then inspect the PORT for each. - richc

1 Answers

3
votes

No.

PCF operations like getting the list of queues require you to connect to a queue manager first. To get the list of queue managers on a machine requires OS-level commands instead. A couple of ways that can be done

  • run dspmq (if you can work out where it might be - cannot assume it's always in /opt/mqm/bin and might require setmqenv to give it a workable environment) and then parse the output
  • directly parse /var/mqm/mqs.ini (more challenging on Windows or even worse on z/OS).

And if you're trying to do it remotely, then you have to wrap it up in something like ssh.