I'm using Spring cloud stream with spring cloud function with reactive approach. My binder is RabbitMQ. By definition maxAttempts property is the number of times that a message can be processed (that's what I interpret) From: https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/3.0.6.RELEASE/reference/html/spring-cloud-stream.html#_consumer_properties
maxAttempts: If processing fails, the number of attempts to process the message (including the first). Set to 1 to disable retry. Default: 3.
The problem is my application with this (default) configuration always processed the message 4 times. And now I want to disable the retry, so I set max-attempts=1 and the message is always processed 2 times.
I have already tried to set spring.cloud.stream.rabbit.bindings.input.consumer.requeue-rejected=false
although is the default.
Any clue on how can I get my message processed just once?
Thanks.
maxAttempts=1
, the binder does not add aRetryTemplate
to the channel adapter so no retries will occur. Something else is going on. Please provide a small, complete, example that exhibits this behavior. – Gary Russell