Ack now or too lat - weird behaviour of transaction on ActiveMQ over stomp
I use stomp (1.2) to connect to ActiveMQ (5.15). It is a Python client and stomp.py 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.
>> def on_message(self, header, body):
>> print(‘get message %s’, header[‘ack’])
>>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()
>>txid2 = conn.begin()
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.
Sent from Polymail<https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature>
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<https://player.vimeo.com/external/255397834.hd.mp4?s=fa14d977acd8d1732fcd6341d22450dc62687e87&profile_id=175> 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.