I'm trying to setup a scenario where the listeners will manually send ACK to RabbitMQ. I have this in my application.properties
spring.cloud.stream.rabbit.bindings.input.consumer.acknowledge-mode=MANUAL
How do I send an ack from the listener? I see from Manual Acknowledgement of Messages : Spring Cloud Stream Kafka that for Kafka, we create an Acknowledgement object and call acknowledge() in it. Is there an example for RabbitMQ to do the same?
See the Spring Integration Reference Manual. The message has two headers, AmqpHeaders.CHANNEL
and AmqpHeaders.DELIVERY_TAG
.
You need to call basicAck
on the channel, passing in the delivery tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With