activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murphy Meng <>
Subject Ack now or too lat - weird behaviour of transaction on ActiveMQ over stomp
Date Thu, 15 Nov 2018 15:36:54 GMT

I use stomp (1.2) to connect to ActiveMQ (5.15). It is a Python client and library
is employed. A transaction begins when one message is received, the client does some processing
then acknowledge the message, then commit the transaction. Such loop starts over when a new
message is received.

There is a scenario where I found the problem. There could be more then one messages are received
before the transaction begin-process-ack-commit loop. And such loops handle only one message
in one go. What is the issue? The second message received earlier will not be acknowledged
at all.

Pseudo code:
>>class mylistener:
>>  def on_message(self, header, body):
>>    print(‘get message %s’, header[‘ack’])
>>conn.set_listener(‘listener1’, mylistener());
>>conn.subscribe(destination=‘queue1', id=1, ack=‘client-individual’)
>>get message ID:03367ac6c23d-44027-1542285031966-10:1
>>get message ID:03367ac6c23d-44027-1542285031966-10:2
>>txid1 = conn.begin()
>>conn.ack(‘ID:03367ac6c23d-44027-1542285031966-10:1’, txid1)
>>txid2 = conn.begin()
>>conn.ack(‘ID:03367ac6c23d-44027-1542285031966-10:1’, txid2)

At this point, the second message is not acknowledged at all. You will find out it stays in
the queue and will not be redelivered (if the client is not disconnected).

Anyone can tell me is this designed? I don’t see any statement like this in stomp spec.
It looks quite problematic for me.

Best regards,

Murphy Meng
Sent from Polymail<>

Murphy Meng
API Software Developer /
96 Great Suffolk Street, London, SE1 0BE, GB


Next Gen Advertising Award winner, Content Innovation Awards.
Best Video Marketing & Advertising Platform winner, Digiday Technology Awards.
Take a look to see what Mirriad In-Video Advertising<>
can do for your business.

This message contains confidential information and is intended only for the individual(s)
addressed in the message.
If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail.
If you are not the intended recipient, you are notified that disclosing, distributing, or
copying this e-mail is strictly prohibited.

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