H, I am looking to create a connection pool for activeMQ producers, which will bw available to serve as a connection object to any queue. I have seen the implementation of JMS::PooledConnection, probably I wold need the same implementation in CMS as well (couldn't find any while searching though). Is there any API available to serve the same, or is there any other way to get the said functionality.
Asked
Active
Viewed 53 times
1 Answers
0
There isn't any open source implementation of a JMS style connection pool for CMS that I'm aware of. There's no reason that there couldn't be one other than nobody has taken the time to write one. The actual logic of the pooled connection stuff for JMS isn't all that complicated, just some multi-threaded access cases that require work to get right.

Tim Bish
- 17,475
- 4
- 32
- 42
-
Hi Tim, thanks for the reply. After going through the design, I think my solution might use CMS::PoolesSession instead of a pooled connection. However, I'm facing the following problem: I am using a SessionPool object and after creating the session, I'm adding all the resources to the ResourceLifecycleManager object that I'm creating before the SessionPool object and also passing it to the SessionPool constructor. – Sid Jan 19 '16 at 10:00
-
continued.. However, after sending the message if I call SessionPool::returnSession(), the session object is still holding the reference and is not becoming NULL. I was hoping this object to become NULL as the session is now put back on the pool and I should get the session back by calling getSession()/TakeSession() in that case. At the same time, ResourceLifecyclyManager has also these functions available in that and this, and I'm not sure how to manage these pooled resources. Any help would be appreciated. – Sid Jan 19 '16 at 10:07
-
You'd be better to take this sort of thing to the Apache Users mailing list, I don't think SO is the right place for this type of discussion. – Tim Bish Jan 19 '16 at 14:04
-
Thanks Tim; I'll do that. – Sid Jan 20 '16 at 05:27