-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
In what version(s) of Spring for Apache Kafka are you seeing this issue?
2.9.1
Describe the bug
It is about the value of the Header "kafka_deliveryAttempt" (KafkaHeaders.DELIVERY_ATTEMPT).
When used in combination with non-blocking retries, from the 2nd non-blocking attempt, it starts with the value 2 instead of 1.
Example: in a configuration with 2 blocking retries (Backoff with 2 maxAttempts) and a RetryTopicConfiguration with .maxAttempts(3), one would expect the value of the Headers in each listener invocation to be:
kafka_deliveryAttempt=1, retry_topic-attempts=null
kafka_deliveryAttempt=2, retry_topic-attempts=null
kafka_deliveryAttempt=3, retry_topic-attempts=null
kafka_deliveryAttempt=1, retry_topic-attempts=2
kafka_deliveryAttempt=2, retry_topic-attempts=2
kafka_deliveryAttempt=3, retry_topic-attempts=2
kafka_deliveryAttempt=1, retry_topic-attempts=3
kafka_deliveryAttempt=2, retry_topic-attempts=3
kafka_deliveryAttempt=3, retry_topic-attempts=3
But instead we have:
kafka_deliveryAttempt=1, retry_topic-attempts=null
kafka_deliveryAttempt=2, retry_topic-attempts=null
kafka_deliveryAttempt=3, retry_topic-attempts=null
kafka_deliveryAttempt=2, retry_topic-attempts=2
kafka_deliveryAttempt=2, retry_topic-attempts=2
kafka_deliveryAttempt=3, retry_topic-attempts=2
kafka_deliveryAttempt=2, retry_topic-attempts=3
kafka_deliveryAttempt=2, retry_topic-attempts=3
kafka_deliveryAttempt=3, retry_topic-attempts=3
To Reproduce
Please see above.
Expected behavior
Please see above.