I am looking for some guidance regarding how to set up an application that listens to clustered queues on multiple queue managers. Below is our current setup:
Physical Box "Alpha": TCP listener defined for port: 1111 Queue Manager Name: QM1 Channel Name: "MyChannel" Queue Name: Q1
Physical Box "Beta": TCP Listener defined for port 1112 Queue Manager Name: QM2 Channel Name: "MyChannel" Queue Name: Q1
An external client application has a connection to QM1 on physical box Alpha on port 1111.
When I PUT messages onto Q1, because of the clustered setup, every second message is placed on either Q1 on QM1 or Q1 on QM2.
When another application is connected to QM2 on physical box Beta on port 1112, it receives only half the messages that have been sent to Q1 because it is not monitoring both queue managers.
Is there a way to connect to both queue managers so that my second application receives all messages that are placed on Q1 regardless of the Queue Manager that it is monitoring?
We are connecting via JMS using the following code:
public static ConnectionFactory createConnectionFactory(final ConnectionString connectionString) throws JMSException {
MQConnectionFactory cf = new MQConnectionFactory();
cf.setHostName(connectionString.getHost());
cf.setPort(connectionString.getPort());
cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);
cf.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR);
cf.setQueueManager(connectionString.getQueueManager());
cf.setChannel(connectionString.getChannel());
return cf;
}