我正在使用具有响应式方法的 Spring Cloud 功能的 Spring Cloud Stream。我的活页夹是 RabbitMQ。根据定义 maxAttempts 属性是可以处理消息的次数(这就是我的解释)来自:https ://cloud.spring.io/spring-cloud-static/spring-cloud-stream/3.0.6.RELEASE /reference/html/spring-cloud-stream.html#_consumer_properties
maxAttempts:如果处理失败,尝试处理消息的次数(包括第一次)。设置为 1 以禁用重试。默认值:3。
问题是我的应用程序使用这个(默认)配置总是处理消息 4 次。现在我想禁用重试,所以我设置 max-attempts=1 并且消息总是被处理 2 次。我已经尝试设置spring.cloud.stream.rabbit.bindings.input.consumer.requeue-rejected=false
虽然是默认设置。
关于如何让我的消息只处理一次的任何线索?
谢谢。