Hi folks, For a long time, I've been in search of an appropriate way of pooling Connection and/or Session objects for both sender and the receiver sides. Some solutions, such as MDBs, are only target the receiver side which are not sufficient for the most cases.
I've looked into three different approaches: MDB, JCA and Messenger framework[1]. Neither of them have seemed perfect. So, I decided to list some pros and cons of those (according to my understanding of course :-) Could someone shed some light on these? Regards, Ali Sadik Kumlali MDB ------ - I can set the number of MDB threads to be used. Therefore, I naturally have multiple connections handled by the J2EE container. - AFAIK, each MDB thread creates a new connection and only a single session on each connection. This means I have dedicated connection and session for each MDB thread. - No connection pool per connection factory and no session pool per connection involved. - It only affects to the receiver side. Sender is still in need to handle connection and session pool. JCA ----- - Need a container (J2EE or Spring + Jenks) - Need a JCA adapter for the given container. For example, JCA adapter for Jenks, WebLogic, WebSphere,... - Both the sender and receiver are able to use it via JNDI lookup. - JCA automatically handles connection pool on both incoming and outgoing directions. - What about session pool? - What if my provider doesn't have a JCA adapter? - What if I'm not able to use Spring and/or a J2EE container? Codehaus / Apache Messenger -------------------------------- - No active development either at Codehaus or Apache - No need a container. - Both sender and receiver side can embed the library. - A session factory is created for the connection factory. AFAIK, no support for multiple connection factories. - According to the shareConnections value, each session can be created from the same or a new connection. - Messenger class encapsulates Connection(which is not used directly) and Session. So, we can think the Messenger class as wrapper of Session. - Framework creates a pool of Messenger objects. That means, we have a Session pool. - No connection pool is created. [1] http://jakarta.apache.org/commons/sandbox/messenger/ http://messenger.codehaus.org/ ____________________________________________________________________________________ Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html