Posted: Fri Apr 10, 2015 1:29 am Post subject: Best practice for jms request reply
Newbie
Joined: 09 Oct 2013 Posts: 5
We have a queue manager running on a windows box and sometime it is difficult to connect to it. It can take 10-20 seconds to get a connection. We see the problem when connecting from both java applications using native MQ classes, java applications running jms and when using the support pack MO72.
I think the problem is a jms application running on WAS that create a connection for each request for the queue manager. The application sends approx. 10 requests per second. For each request the application:
Creates a connection
Creates a session
Creates a producer
Sends the request
Creates a consumer
Receive the reply
Close consumer
Close producer
Close session
Close connection
WAS has configured “0” minimum number of connections in the connection factory connection pool. If the pool is empty then WAS need create 5 connection at the same time if the application reveive 5 requests at the same time. We will try to increase the minimum number of connection to maybe 25.
My question is what the best practice is for connecting to mq via jms when requests are sendt and replies received. Should we only have one connection and reuse it for all requests/replies or is there a better way?
First of all, you can tell really easily if the WAS application is actually the problem, by looking at the status of active svrconn channels and at open sockets on the queue manager machine.
Second of all, the JMS application should be using a QCF to create a connection, and ideally be looking up that QCF from JNDI.
If it's doing that in your step of "create a connection", then it's acting as it should.
You should then tune the connection pool - as you suggest - so that fewer connections are being opened and then closed again in a short period of time. You may still want the pool minimum size to be 0, so that all connections are closed when the JMS app is completely idle. But you might want to examine how long the connections stay alive in the pool...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum