You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by mserrano <ma...@attivio.com> on 2012/02/14 18:55:53 UTC

are session.commit() and consumer.receive allowed simultaneously in separate threads?

>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:



and 



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: http://activemq.2283324.n4.nabble.com/are-session-commit-and-consumer-receive-allowed-simultaneously-in-separate-threads-tp4387875p4387875.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: are session.commit() and consumer.receive allowed simultaneously in separate threads?

Posted by mserrano <ma...@attivio.com>.
For posterity, according to comments on
https://issues.apache.org/jira/browse/AMQ-3720, synchronization on the
session is not required for a consumer.receive() call.

--
View this message in context: http://activemq.2283324.n4.nabble.com/are-session-commit-and-consumer-receive-allowed-simultaneously-in-separate-threads-tp4387875p4395532.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.