I'm using spring and rabbitmq, with auto-ack. I configured a RetryInterceptor (maxAttempts 2, min and max interval 60 secs., multiplier 1), and a x-message-ttl (125 sec. for this test) is configured in the queue. I have only 1 concurrent consumer.
I put 8 messages that will always fail. In this case, there are some messages that go directly to DLQ without being consumed, but I can't understand the logic and the order behind that.
The sequence that I see is:
Message 1 first attempt
Message 1 second attempt
Message 2 first attempt
Message 2 second attempt
Message 3 first attempt
Message 7 expires
Message 8 expires
Message 3 second attempt
Message 4 first attempt
Message 3 expires
Message 4 second attempt
Message 5 first attempt
Message 4 expires
Message 5 second attempt
Message 5 expires
Message 6 first attempt
Message 6 second attempt
Message 1 third attempt
Message 6 expires
Message 1 fourth attempt
Message 2 third attempt
Message 1 expires
Message 2 third attempt
Message 2 expires
What is the explanation to this order and behavior?