我最近发布了这个 如何重新连接到集群中的所有 IBM MQ 队列管理器 问题,有人建议我使用统一的集群作为解决方案。通读文档似乎正是我们所需要的。
我们的基础架构人员配置了统一集群,我正在尝试连接到它并测试功能。
为了连接到它,我创建了一个类似于以下内容的 json CCDT 文件:
{
"channel":
[
{
"general":
{
"description": "My channel",
"maximumMessageLength": 4194304
},
"name": "CHANNEL.NAME",
"clientConnection":
{
"connection":
[
{
"host": "server1",
"port": 1414
}
],
"queueManager": "QM1"
},
"transmissionSecurity":
{
"cipherSpecification": "TLS_AES_256_GCM_SHA384"
},
"type": "clientConnection"
},
{
"general":
{
"description": "My channel",
"maximumMessageLength": 4194304
},
"name": "CHANNEL.NAME",
"clientConnection":
{
"connection":
[
{
"host": "server2",
"port": 1414
}
],
"queueManager": "QM2"
},
"transmissionSecurity":
{
"cipherSpecification": "TLS_AES_256_GCM_SHA384"
},
"type": "clientConnection"
},
{
"general":
{
"description": "My channel",
"maximumMessageLength": 4194304
},
"name": "CHANNEL.NAME",
"clientConnection":
{
"connection":
[
{
"host": "server3",
"port": 1414
}
],
"queueManager": "QM3"
},
"transmissionSecurity":
{
"cipherSpecification": "TLS_AES_256_GCM_SHA384"
},
"type": "clientConnection"
},
{
"general":
{
"description": "My channel",
"maximumMessageLength": 4194304
},
"name": "CHANNEL.NAME",
"clientConnection":
{
"connection":
[
{
"host": "server1",
"port": 1414
},
{
"host": "server2",
"port": 1414
},
{
"host": "server3",
"port": 1414
}
],
"queueManager": "*"
},
"transmissionSecurity":
{
"cipherSpecification": "TLS_AES_256_GCM_SHA384"
},
"type": "clientConnection"
}
]
}
换句话说,我试图创建一个到每个队列管理器的客户端连接,以及一个到三个队列管理器组的第四个连接。最初此条目不在文件“queueManager”中:“*”但是在尝试运行时我得到missing required attribute。这让我把那个“*”。错误消失了,但我仍然无法连接,这让我认为我的 CCDT 配置有误。在客户端,我有这个
ConnectionFactory
创作:
connectionFactory.setTransportType(WMQ_CM_CLIENT);
if (Objects.isNull(ccdtUrl)) {
connectionFactory.setConnectionNameList(connectionNameList);
connectionFactory.setChannel(queueManagerChannel);
connectionFactory.setPort(connectionPort);
} else {
connectionFactory.setCCDTURL(ccdtUrl);
}
connectionFactory.setCCSID(1208);
connectionFactory.setClientReconnectOptions(WMQ_CLIENT_RECONNECT_Q_MGR);
connectionFactory.setClientReconnectTimeout(reconnectTimeout);
connectionFactory.setAppName(applicationName);
if (sslEnabled) {
connectionFactory.setSSLCipherSuite(sslCipherSuite);
connectionFactory.setSSLFipsRequired(sslFipsRequired);
System.setProperty("com.ibm.mq.cfg.useIBMCipherMappings", useIBMCipherMappings);
}
你能告诉我我做错了什么吗?我该如何解决。我以前没用过CCDT。
提前谢谢你。