I am using WebSphere MQ 8.0.
I want add two Queue Managers, say QM1 and QM2, to a cluster programatically using Programmable Command Format (PCF) in Java.
I am able to add QM1 to the cluster as a full repository using the following code.
PCFMessageAgent agent = new PCFMessageAgent("QM1");
agent.setCheckResponses(false);
PCFMessage[] responses;
PCFMessage request = new PCFMessage(MQConstants.MQCMD_CHANGE_Q_MGR);
request.addParameter(MQConstants.MQCA_REPOSITORY_NAME, "CLUSTER1");
responses = agent.send(request);
How do I Add QM2 as a partial repository to the cluster?
Any suggestions as to how I can improve/achieve this are welcome.
You need to follow the same procedure as for MQSC commands but using PCF.
CLUSRCVR
channel specifying CONNAME('dns or ip(port)')
and CLUSTER('CLUSTER1')
.CLUSSDR
to the primary full repository.The QMgr will not resolve in the cluster until the last step.
Also, be sure to define your RCVR channel as CLUSTER1.QM1
instead of as TO.QM1
so that you never have a channel shared across clusters.