I'm working with spring amqp and I use asynchronous return types like Mono
. The one of my handlers:
@RabbitHandler
public Mono<Response<PopularityReport>> popularityReport(PopularityReportCommand command) {
return Mono.just(foo);
}
When I use such an approach I get the next warning:
[ntContainer#0-1] .a.r.l.a.MessagingMessageListenerAdapter : Container AcknowledgeMode must be MANUAL for a Mono<?> return type; otherwise the container will ack the message immediately
I could use the next approach for manual acknowledgments. But I have a hundred handlers and for this reason, that approach seems me like inconvenient (I need to change all handlers).
I wanna acknowledge all messages only after successful execution. How could I write a global strategy for all my handlers in one place without changing the old code?