[jboss-dev-forums] [Design of JBoss ESB] - Re: JmsConnectionPool: Allowing control over the number of S
tfennelly
do-not-reply at jboss.com
Fri May 15 07:57:24 EDT 2009
So we went for a less intrusive implementation of this. Originally I was working on creating a new JmsSessionPool class and in it, collapsing those 4 Maps down to just a single Map and eliminating all the juggling of sessions between Maps. We decided not to do this at this point, so I then went back and just extended the existing "patterns" inside JmsConnectionPool to accommodate multiple connections.
So what we have right now (working - full CI build) is the old JmsConnectionPool with:
1. An inner JmsSessionPool class for managing sessions associated with a single connection. It basically contains code moved down from the JmsConnectionPool class.
2. The JmsConnectionPool has exactly the same interface as before. It now manages a list of JmsSessionPool objects (List). It gets a session by looping over the session pool list, asking each session pool for a session. If non of the existing pools have a free session, it will create a new connection and add a new session pool for that connection (if it hasn't hit "maxConnections").
"maxConnections" (i.e. max number of session pools) is currently calculated based on the existing "org.jboss.soa.esb.jms.connectionPool" config from the jbossesb-properties.xml file (which is actually the max total number of sessions for the whole connection pool), as well as a new config param called "max-sessions-per-connection", which is currently coming from the "poolKey" (i.e. jndiEnv) used to create the JmsConnectionPool.
So maxConnections = (maxSessions/maxSessionsPerConnection);
This is not quite right though. I don't think we can take maxSessionsPerConnection from the poolKey because of how the JmsConnectionPoolContainer works. Seems to me like this setting also needs to come from the jbossesb-properties.xml file, but we would need to have a setting per JMS Provider. We could base this on the initial context factory class name e.g.:
<property name="org.jboss.soa.esb.jms.max.sessions.per.connection_com.ibm.mq.jms.context.WMQInitialContextFactory" value="1" />
This is not ideal either because I think you may need a different value for max.sessions.per.connection on the same provider, depending on other params e.g. whether or not the connections are XA (ala this forum topic).
Not pretty :)
Options and opinions?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231293#4231293
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231293
More information about the jboss-dev-forums
mailing list