简体   繁体   中英

Depth of IBM MQ queue

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM