What is a proper way to acknowledge an MQ message from a chain of actors?

148 views
Skip to first unread message

Vagif Abilov

unread,
Dec 30, 2015, 6:35:33 AM12/30/15
to Akka User List
Hello,

We want to use Akka to implement a scenario when messages are fetched from a message queue (RabbitMQ) and then processed by a chain of actors. The queue is durable and messages must not be lost. So we need to send an acknowledgement (BasicAck in RabbitMQ) back to the queue in order to finalize the dequeued message. Because of that the very last actor in the processing chain needs to do the acknowledgement. This seems to be rather common need, and I wonder if there is a known pattern for this. Vaughn Vernon in his book writes about using Return Address for such purpose so all messages sent along the chain will have the return address (of the MQ channel actor) and the correlation identifier that specifies the queue message tag. Is this the proper way to do it?

An alternative is to ack the message right after the receival and then use persistent actors to provide its guaranteed delivery, but I was adviced against such approach because use of AMPQ eliminates the need for actor persistance for this particular scenario.

Thanks in advance

Vagif

Greg Young

unread,
Dec 30, 2015, 12:36:47 PM12/30/15
to Akka User List
The manual ack as received from a message is a common pattern. Normally you would want an actor that represents the subscription, you can then pass forward the address of this actor so other actors can respond back when completed. However if this process gets to be more than a few actors you are likely better off to have an actor that represents the process as a whole and the interactions that occur who is then responsible for the ack/nak at the end.

Vagif Abilov

unread,
Dec 30, 2015, 12:47:46 PM12/30/15
to akka...@googlegroups.com

Thanks Greg, this is exactly what I was trying to figure out.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/0ILTqdCvMxo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages