You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Alex J Lennon <aj...@dynamicdevices.co.uk> on 2008/04/05 17:45:36 UTC

Questions about transactions with ActiveMQ

Hi,

I've been testing out Apache NMS with MSMQ and ActiveMQ.

The test platform is a Windows XP box with and ActiveMQ 5.0.0. running 
with default settings.

I'm using client code based on that found here:
http://activemq.apache.org/nms/nms.html

Initially I found that I got an exception when closing the session to the
message broker. Disposing the producer and consumer prior to closing
the session seems to fix that.

One of my tests is with AcknowledgementMode.Transactional. I loop, sending
a message on the producer, committing on the session and then receiving a 
message on the consumer.

This seems to work nearly correctly, but browsing the queue on the ActiveMQ
web admin page I see there is always one message left pending (although I
do receive all messages in the client).

I looked at the NMS.ActiveMQ Producer and Consumer code and see that the
producer handles transaction commits. However the consumer code doesn't
seem to handle transactions, but supports some kind of auto-acknowledge
instead (?).

My question is shouldn't the consumer support transactions on the receive()
and is this why I'm left with a message pending? Or am I just
misunderstanding
how to use the API in transactional mode?

Thanks!

Alex Lennon
-- 
View this message in context: http://www.nabble.com/Questions-about-transactions-with-ActiveMQ-tp16514728s2354p16514728.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.