I am running a simple Java client to connect to a remote MQ queue.
When I run Java code to read write messages with the alias queue name, it works fine.
When I try to run the code in the same queue but with the name of the physical queue (because I want to call getQueueDepth), I get error 2035 at the point when the code tries to establish a connection
Permissions on the queue: browse + dsp + get + inq + put + set + setall
Java code has a value of <
import com.ibm.mq.MQC; import com.ibm.mq.MQEnvironment; import com.ibm.mq.MQException; import com.ibm.mq.MQGetMessageOptions; import com.ibm.mq.MQMessage; import com.ibm.mq.MQPutMessageOptions; import com.ibm.mq.MQQueue; import com.ibm.mq.MQQueueManager; public class MQSniffer {
public static void main(String[] args) { String hostname = "XXXX"; String channel = "CHANNEL"; String qManager = "qmgr"; MQQueueManager qMgr; MQEnvironment.hostname = hostname; MQEnvironment.channel = channel; MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES); try { qMgr = new MQQueueManager(qManager); int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT ; MQQueue system_default_local_queue = qMgr.accessQueue("PHYSICAL_QUEUE_NAME",
}
om.ibm.mq.MQException: MQJE001: Termination Code 2, reason 2035 at com.ibm.mq.MQQueueManager.accessQueue (MQQueueManager.java:2858) at org.ku.benchmarkos.MQSniffer.main (MQSniffer.java)
Any help is appreciated!
Thanks J
source share