activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <>
Subject Re: Session, MessageProducer are thread safe
Date Mon, 24 Jul 2006 15:45:49 GMT
Creating a session and producer are cheap compared to creating a

Synchronizing send from one thread at a time is might be a valid solution.
It depends how long the send() method blocks.  If it blocks too long then
there will be too much contention trying to access the send.  So you want
the send() method not to block, which is the case when ActiveMQ is using
async sends.  For more info on async sends see:

On 7/21/06, Vishu <> wrote:
> My requirement is something like my app will make connection, create
> session
> and MessageProducer... then I have multiple threads to send messages in MQ
> at once...
> As I read from JMS spec .. connection is thread safe but session and
> messageProducer are not...
> so I have two options
> 1. make send call synchronise ... send from one thread at a time..
> 2. create session and messageProducer for each thread then send message
> concurrently..
> I don't know what are performance issues .. in both the situations..
> I don't how heavy to create session and messageProduder from every thread
> when thare is send call..
> tanx
> vish
> --
> View this message in context:
> Sent from the ActiveMQ - User forum at



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message