Hi, do we have any way to check if each MQ manager are really using same MQSimpleConnectionManager, my code is basically as below,
block start{
MQQueueManager qmgr1=new MQQueueManager(null,mqSimpleConMan);
requestedQueue1=qmgr1.accessQueue(Q_Name, options)
MQQueueManager qmgr2=new MQQueueManager(null,mqSimpleConMan);
requestedQueue2=qmgr2.accessQueue(Q_Name, options)
After use I am closing both MQQueueManager
requestedQueue1.close()
requestedQueue2.close()
qmgr1.disconnect()
qmgr2.disconnect()
}Block ends
Thread.run(above code)
I have done the coding. Just wanted to make sure it's working as expected (like utilizing MQSimpleConnectionManager each time)
------------------------------
Irfan Ali Shaheed
------------------------------
Original Message:
Sent: Tue October 05, 2021 11:11 AM
From: Brian S Paskin
Subject: Connection pool
Can you show your code?
Brian
------------------------------
Brian S Paskin
Sr. Web Engineer
IBM Tech Garage
Original Message:
Sent: Tue October 05, 2021 10:54 AM
From: Irfan Ali Shaheed
Subject: Connection pool
Hi Brian/All,
I have implemented the solution as per your advice. It working absolutely perfect.
The challenge I am facing is in multithreaded environment. Requirement is to run 4(max, min is 2) different threads, which will try to use the 4 different pool to make MQ connections. I am trying with 2 threads as of now, problem here is each time its creating new connection to use. I have refer below IBM site for help,
https://www.ibm.com/docs/en/ibm-mq/9.0?topic=cpimcj-supplying-different-connection-pool-in-mq-classes-java
Please suggest.
------------------------------
Irfan Ali Shaheed
Original Message:
Sent: Thu September 02, 2021 08:46 AM
From: Brian S Paskin
Subject: Connection pool
Hi, here is a sample program, with hardcoded values. You if you change the max number of connections to 1, then the app will fail after 1 connection stating the all connections are in use (MQRC 2025).
- Brian
EDIT: Since it did not format well. I placed it in my Github.
------------------------------
Brian S Paskin
Sr. Cloud Engineer
IBM Technology Garage
Original Message:
Sent: Wed September 01, 2021 05:49 AM
From: Irfan Ali Shaheed
Subject: Connection pool
I want to implement MQ connection pool without JMS. like using MQSimpleConnectionManager. I tried to get help from document site but it doesn't contains any full block/program. any suggestion will be very helpful.
------------------------------
Irfan Ali Shaheed
------------------------------