MQ\Java - accessQueue() method - what should be the openOptions to avoid queue lock

StackOverflow https://stackoverflow.com/questions/23543078

  •  18-07-2023
  •  | 
  •  

Domanda

I am writing a monitoring tool for a system which uses MQ websphere. I want to check the queues depth by using the getCurrentDepth() method. To be able to do so, I first need to access the queue using the function:

public MQQueue accessQueue(String queueName, int openOptions, 
                       String queueManagerName, 
                       String dynamicQueueName, 
                       String alternateUserId) 
          throws MQException;

My concern is that the call to getCurrentDepth() will lock the specific queue for some period of time, which is very bad for the monitored system. My guess is that the openOptions are the solution but I haven't found any helpful information regarding these options accept for the IBM WebSphere MQ API

Any assistance will be much appreciated. Thanks.

È stato utile?

Soluzione

In order to inquire the current depth you will have to use the MQOO_INQUIRE open option.

However, that said, most monitoring tools would use PCF not MQINQ as the MQINQ verb is limited to things a business application, not a monitoring application would need. If all you want is the current depth, then fine, but if you intend to monitor anything else, you'll need to change tack.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top