Manual acknowledgement for consumed messages?
See original GitHub issueHi guys, I have a non-trivial case, where I have a queue with multiple message types and a single consumer subscribed to this queue.
Additionally, I want to buffer messages (based on some business logic) and only acknowledge them, when I am sure that they are successfully processed.
Basically what I need is to disable the default ack behavior that acks the message once the onMessage handler finishes execution, and I want to send the ack manually, based on the business logic of my application.
I want to achieve something like this:
var orderEvents = new List<IMessage<OrderEvent>>();
var positionEvents = new List<IMessage<PositionEvent>>();
bus.Advanced.Consume(queue, registration =>
{
registration
.Add<OrderEvent>((message, info) => orderEvents.Add(message))
.Add<PositionEvent>((message, info) => positionEvents.Add(message));
});
.... <Several Business Rules Later> ...
// queue.Acknowledge doesn't exist, It's just for illustration.
orderEvents.ForEach(orderEventMessage =>
queue.Acknowledge(orderEventMessage))
If someone can point me to an API that exists and can achieve this, and I somehow skipped it, or a workaround that I can use, that would be great.
Thanks in advance!
Regards.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Manual message acknowledgment in Apache Kafka
As you know Kafka has a way to acknowledge the message whether it was consumed or read by the server. This process can...
Read more >Consumer Acknowledgements and Publisher Confirms
Manual acknowledgement mode is typically used with a bounded channel prefetch which limits the number of outstanding ("in progress") deliveries on a channel....
Read more >Manual Acknowledge (commit) kafka messages with ...
I'm using ReplyingKafkaTemplate.sendAndReceive() to send and receive a message correlated by correlation id. The use case have many topics on ...
Read more >3. Reference
MANUAL - the message listener ( AcknowledgingMessageListener ) is responsible to acknowledge() the Acknowledgment ; after which, the same semantics as ...
Read more >Acknowledgement - SmallRye Reactive Messaging
A message is acknowledged when its processing or reception has been successful. It allows the broker to move to the next message. How...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reading the RabbitMQ confirm documentation (https://www.rabbitmq.com/confirms.html) you’ll see that all the acks/rejects are in the Received scope. I don’t see how this can be done if RabbitMQ doesn’t support manual ack outside the Received scope.
Did this ever get done. It is quite important when using RabbitMQ to be able conditionally ackknowledge messages or reject them or requeue etc, this would be a great addition and i would move to this library if it did this