【发布时间】:2021-10-20 07:58:52
【问题描述】:
我正在使用spring amqp,我使用异步返回类型,例如Mono。我的处理程序之一:
@RabbitHandler
public Mono<Response<PopularityReport>> popularityReport(PopularityReportCommand command) {
return Mono.just(foo);
}
当我使用这种方法时,我会收到下一个警告:
[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
我可以使用下一个approach 进行手动确认。但是我有一百个处理程序,因此,这种方法似乎不方便(我需要更改所有处理程序)。
我只想在成功执行后确认所有消息。 如何在不更改旧代码的情况下在一个地方为所有处理程序编写全局策略?
【问题讨论】:
标签: spring rabbitmq project-reactor spring-amqp