Reputation: 51
Can you please help me, I am trying to find the ibm mq depth over SSL channel.
Security.setProperty("ssl.SocketFactory.provider",
"com.ibm.jsse2.SSLSocketFactoryImpl");
Security.setProperty("ssl.ServerSocketFactory.provider",
"com.ibm.jsse2.SSLServerSocketFactoryImpl");
System.setProperty("javax.net.ssl.trustStore", "abcd.jks");
System.setProperty("javax.net.ssl.trustStorePassword",
"abcd");
System.setProperty("javax.net.ssl.keyStore", "abcd.jks");
System.setProperty("javax.net.ssl.keyStorePassword",
"abcd");
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_INPUT_AS_Q_DEF;
MQEnvironment.hostname = "test";
MQEnvironment.port = 1234;
MQEnvironment.channel = "test";
MQEnvironment.sslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA";
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES_CLIENT);
MQQueueManager qMgr = new MQQueueManager("test");
MQQueue destQueue = qMgr.accessQueue("TEST.ERROR", openOptions);
System.out.println("TEST.ERROR size:" + destQueue.getCurrentDepth());
destQueue.close();
qMgr.disconnect();
} catch (MQException e) {
e.printStackTrace();
}
When I try to run this code, I got the following exception:
MQJE001: Completion Code 1, Reason 2068
Upvotes: 1
Views: 740
Reputation: 2698
The reason code 2068 clearly states that you are trying to get the depth of a remote queue. You can't - it's on a different box. You have to connect to the queue manager where your TEST.ERROR
queue is local.
Upvotes: 2