Re: Ack now or too lat - weird behaviour of transaction on ActiveMQ over stomp
Your pseudocode uses the same message ID for both acks, so the behavior you
describe is correct for your pseudocode. Is the pseudocode reflective of
your actual code in that respect?
On Thu, Nov 15, 2018, 8:37 AM Murphy Meng <firstname.lastname@example.org
> 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
> 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
> murphy.meng@xxxxxxxxxxx /
> 96 Great Suffolk Street, London, SE1 0BE, GB
> Next Gen Advertising Award winner, Content Innovation Awards.
> Best Video Marketing & Advertising Platform winner, Digiday Technology
> 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.