Why do you want to stop the connection pool?
http://incubator.apache.org/activemq/how-do-i-use-jms-efficiently.html
On 7/28/06, Paul French <paul.french@frenchiesystems.com> wrote:
>
> I have a work around but I'm wondering if anyone else has a better idea?
>
> I use a PooledConnectionfactory for my JMS connections.
>
> I start say 10 threads from my main thread all part of the same thread
> group. They send some JMS messages and then finish.
>
> I need to detect when all the threads have finshed so I can close the
> PooledConnectionFactory by calling stop() to release the system resources.
>
> The problem I have is the first JMS call within one of the new threads
> starts up the acivemq processes on the client (3 of them, a connection and 2
> schedulers) and they automatically become part of my ThreadGroup. These
> threads never die!! Hence even when all my threads stop I still have active
> activemq threads part of the threadgroup.
>
> I did a work around by calling start on the PooledConnectionFactory from
> within the main thread before I started my 10 threads. Then it is easy to
> check the threadgroup active count is zero before I call stop().
>
> Any better ideas since I'm not sure if I will always have the luxury of
> pre-starting the connection pool.
> --
> View this message in context: http://www.nabble.com/running-a-jms-client-with-mulitple-threads-tf2016632.html#a5543879
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
James
-------
http://radio.weblogs.com/0112098/
|