Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find local transmission queue of remote MQ queue in Java?

Tags:

java

ibm-mq

mq

in my Java application I get MQQueue object using

MQQueue tQueue  = qManager.accessQueue(tqName, tqOptions);

The queue is a remote queue. Is there way to get corresponding local transmission queue ?

(Using MQ 7.5)

Thanks

like image 716
Aleksandr Broytman Avatar asked Sep 27 '22 11:09

Aleksandr Broytman


1 Answers

Yes, using runmqsc console.

First on a command prompt run

runmqsc <qmgr>.

Once the console opens run

dis qr<remote q> XMITQ

to display the transmit queue used by the remote queue definition.

UPDATE

Another method is to use PCF classes.

      PCFMessageAgent pcfma = new PCFMessageAgent("QM");
      PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_Q);
      pcfCmd.addParameter(MQConstants.MQCA_Q_NAME, "Q.REMOTE");
      PCFMessage[] pcfResponse = pcfma.send(pcfCmd);
      String xmitQName = (String) pcfResponse[0].getParameterValue(MQConstants.MQCA_XMIT_Q_NAME);
      System.out.println("XmitQ name " + xmitQName);
like image 199
Shashi Avatar answered Nov 01 '22 10:11

Shashi