Firstly, it is worth noting that the proposed design is a very VERY poor design. The effect is to turn asynchronous messaging into synchronous messaging. These message makers for couples inform consumers, introduce location and resolution dependencies, break clustering, lose load balancing and WMQ balancing, inject the network topology into the application and make the whole system fragile. Please do not blame WMQ for malfunctioning after deliberately defeating all of its best features, except for actual queue / deactivation operations.
However, to more accurately answer your question, use the getOpenInputCountqueue object method to get the number of open input descriptors. Here's how:
MQQueue outQ = qMgr.accessQueue(qName,
openOptions,
null,
null,
null);
int inCount = outQ.getOpenInputCount();
, . QMgr, , , . , , QMgr. , , , QMgr. , PCF .