mlevit
mlevit

Reputation: 2736

Retrieving queue depth using hermesJMS or shell script of WebSphere MQ

I have hermesJMS setup and soapUI. I'd like a small script that can go in either via hermesJMS or another way to retrieve the queue depth of a particular queue.

Is there a way to do this easily?

Thanks

Upvotes: 1

Views: 1364

Answers (1)

T.Rob
T.Rob

Reputation: 31832

The JMS specification does not provide an API for object inquiry, however IBM provides one using native Java classes and the C API using Programmable Command Formats, or PCF for short. The PCF reference docs are here.

If you have installed the WMQ client code (free download with registration) you will have the sample programs on your laptop. By default, these reside in C:\Program Files (x86)\IBM\WebSphere MQ\tools\pcf\samples for Windows or in /opt/mqm/samp/ for UNIX/Linux. Take a look at PCF_ListQueueNames.java for a starting point. If you were to substitute MQCMD_INQUIRE_Q for MQCMD_INQUIRE_Q_NAMES in that program you'd be very close to what you require.

Alternatively since you requested alternatives, you might look at SupportPac MO72. This SupportPac can be used as a client version of runmqsc so that you can, from a central server, write scripts that query your entire WMQ network. Of course, it also works in local bindings mode. Among the other features that make MO72 great for scripting is an option to format output to one line per object. This lets you grep out the line of interest, then strip out the value of interest.

Upvotes: 1

Related Questions