Support Article
How to implement connection pooling using Rule-Connect-MQ
SA-4491
Summary
How to implement connection pooling using Rule-Connect-MQ.
Resolution
1. Create an activity @baseclass.startMQPool. Add one java step and put in the following code:
synchronized (com.ibm.mq.MQEnvironment.class) {
oLog.infoForced("Creating connection pool first time");
com.ibm.mq.MQSimpleConnectionManager connMan
= new com.ibm.mq.MQSimpleConnectionManager();
connMan.setActive(com.ibm.mq.MQSimpleConnectionManager.MODE_ACTIVE);
connMan.setTimeout(3600000);
connMan.setMaxConnections(50);
connMan.setMaxUnusedConnections(50);
com.ibm.mq.MQEnvironment.setDefaultConnectionManager(connMan);
}
The setTimeOut, setMaxConnections and setMaxUnusedConnections need to be set based on the implementation needs.
2. Create a new Rule-Agent-Queue instance called MQConnectionPool.
3. Schedule one activity @baseclass.startMQPool and set the pattern to "Periodic" and the interval to a very large number, like 4000000.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.