The block synchronizes on the message producer, which means it's here
in case the *same* producer is used from several different threads, so
it should not have much overhead when using multiple producers (which
would be recommand afaik).

For the pooling part, the first thing is that consuming messages and
pooling is quite incompatible usually.  The main problem is that if
you keep unused consumers alive, messages can be waiting on the
consumer and thus never be actually delivered (if you don't consumer
those messages or close the consumer).
For session / producer pooling, you should be free to use the pooled
connection factory.

On Tue, Feb 3, 2009 at 15:55, soody <atins...@gmail.com> wrote:
>
> I am working on JMS pooling and have a few doubts
> 1)I was going through the pool package of ActiveMQ. In PooledMessageProducer
> we have s.th like
>
>  // just in case let only one thread send at once
>        synchronized (messageProducer) {
>            messageProducer.send(destination, message, deliveryMode,
> priority, timeToLive);
> }
>
> in the send method.
>
> I am not sure why we need to have the send synchronized. AS far as I
> understand we can use as many producers from a session and send msgs in
> parallel from them to the same destination.... Only thing that can get
> messed up is there will be no order in which these msgs are sent. But I
> guess when we decided to use multiple threads to send msgs we have anyways
> made our choice to drop the sequencing order.
>
> 2)Also there has been much discussion the pooling thing but there is nothing
> concrete. I guess for any JMS client we can write a wrapper around the
> PooledConnectionFactory and other classes and make sure that we have a
> number of connections and a pool of sessions associated with it. We can use
> these for pooling.
> Does it make any diff if we use this for producing or consumption of msgs.
> Please note I am talking about a standalone JMS Client, no springs included
> and a pretty generic client that can work with any JMS provider.
>
>
> --
> View this message in context: 
> http://www.nabble.com/JMS-pooling...-pool-package-in-activeMQ-tp21811493p21811493.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply via email to