您能帮帮我吗,我正在尝试通过 SSL 通道使用 PCFAgent 查找 ibm mq 深度。
Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
Security.setProperty("ssl.ServerSocketFactory.provider", "com.ibm.jsse2.SSLServerSocketFactoryImpl");
System.setProperty("javax.net.ssl.trustStore","abc-dev.jks");
System.setProperty("javax.net.ssl.trustStorePassword","abcdabcd");
System.setProperty("javax.net.ssl.keyStore", "abc-dev.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "abcdabcd");
MQEnvironment.sslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA";
int attrs[] = { 2016, 3 };
System.out.println("parameter creation");
PCFParameter parameters[] = { new MQCFST(2016, "*"), new MQCFIN(20, 1),
new MQCFIL(1002, attrs) };
String name = null;
Integer depth = null;
System.out.println("parameter creation end");
try {
PCFAgent agent;
if (args.length == 1) {
System.out.print("Connecting to local queue manager " + args[0]
+ "... ");
agent = new PCFAgent(args[0]);
} else {
System.out.print("Connecting to queue manager at " + args[0]
+ ":" + args[1] + " over channel " + args[2] + "... ");
agent = new PCFAgent(args[0], Integer.parseInt(args[1]),
args[2]);
}
System.out.println("Connected.");
System.out.print("Sending PCF request... ");
com.ibm.mq.MQMessage responses[] = agent.send(13, parameters);
System.out.println("Received reply.");
for (int i = 0; i < responses.length; i++) {
MQCFH cfh = new MQCFH(responses[i]);
if (cfh.reason == 0) {
for (int j = 0; j < cfh.parameterCount; j++) {
PCFParameter p = PCFParameter
.nextParameter(responses[i]);
switch (p.getParameter()) {
case 2016:
name = (String) p.getValue();
break;
case 3: // '\003'
depth = (Integer) p.getValue();
break;
}
}
System.out.println("Queue " + name + " curdepth " + depth);
} else {
System.out.println("PCF error:\n" + cfh);
for (int j = 0; j < cfh.parameterCount; j++)
System.out.println(PCFParameter
.nextParameter(responses[0]));
}
}
System.out.print("Disconnecting... ");
agent.disconnect();
System.out.println("Done.");
} catch (ArrayIndexOutOfBoundsException abe) {
System.out
.println("Usage: \n\tjava ListQueueDepth queue-manager\n\tjava ListQueueDepth host port channel");
} catch (NumberFormatException nfe) {
System.out.println("Invalid port: " + args[1]);
System.out
.println("Usage: \n\tjava ListQueueDepth queue-manager\n\tjava ListQueueDepth host port channel");
} catch (MQException mqe) {
System.err.println(mqe);
} catch (IOException ioe) {
System.err.println(ioe);
}
当我尝试远程运行该程序时,出现以下异常:
com.ibm.mq.MQException:MQJE001:完成代码 2,原因 2035
编辑从评论中添加额外的澄清细节:
AMQERR01.LOG
MQ Admin在应用程序收到 2035 的同时发现了与 SYSTEM.DEFAULT.MODEL.QUEUE 相关的错误。
当我取消安全设置和密码套件时,相同的程序适用于非 SSL 通道。