[jboss-dev-forums] [Design of JBoss ESB] - JmsConnectionPool: Allowing control over the number of Sessi

tfennelly do-not-reply at jboss.com
Mon May 11 11:20:08 EDT 2009


The current implementation of the JmsConnectionPool is designed to use a single JMS Connection and from it, create all JMS Session instances for the Session pool.

Not all JMS Providers support an unlimmited number of JMS Sessions per Connection.  IBM Websphere MQ (WMQ) is one example if this, but there are probably others too, so we are treating this as a general issue with our JmsConnectionPool. Therefore, we need to modify the JmsConnectionPool code to support this.

I've been trying in vain to reproduce this on WMQ, so in an effort to make some sort of progress, I decided to forget about WMQ for now.  I've reproduced the issue using mocks and we can come back to WMQ at a later date.

There are 2 general solutions as I see it...

Common to both solutions would be a pool of JMS Connections.  For a provider that supports an "unlimited" (not to be taken literally ;) ) number of sessions/connection, this pool would ever only have a single Connection and all Sessions would be created from this.

Then, I think we can manage the relationship between this pool and the sessions created from its connections in one of two ways (remember - general approach):

1.  Maintain a Session Pool per Connection on in the Connection Pool.
2.  Maintain a single Session Pool for all Connections in the Connection Pool.

I would need to play with the code a little, but I think option #2 above might be the least intrusive on the JmsConnectionPool codebase.  We can associate each Session with its owner Connection via the JmsSession class (part of the pooling code).  Then we can manage adding sessions to the central pool by locating an existing Connection from the Connection Pool (one that can still create a Session i.e. has not hit its max session count), or by creating a new Connection in the Pool.

As I said... I really need to play with the code a little now, so this post is just to let people get an idea of what I'm thinking.  If people have any comments, feel free to share them.  Otherwise I'll post back here in a little while :)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230103#4230103

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230103



More information about the jboss-dev-forums mailing list