activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mserrano <>
Subject are session.commit() and consumer.receive allowed simultaneously in separate threads?
Date Tue, 14 Feb 2012 17:55:53 GMT
>From the reading I have done on this list and the documentation, I have come
to the conclusion that if I:

* Need to call session.commit() or message.acknowledge() in one thread
* And need to called consumer.receiveNoWait() in another thread (consumer
was created from the session).

That I need to guard the session against multithreaded access.  So I am
currently doing:


Is the synchronization on the consumer actually required?  I would prefer to
call one of the consumer blocking calls rather than receiveNoWait(), but
cannot allow the session synchronization to be held that long.

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message