rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.31k stars 3.92k forks source link

value of time-key chopped off after every retry in AMQP 0.9.1 x-death header #12731

Closed Alex-The-DevOp-Guy closed 6 days ago

Alex-The-DevOp-Guy commented 6 days ago

Describe the bug

After every requeuing/retry of our Dead-Lettered Messages the time-value is chopped off, until it is 0.

Reproduction steps

  1. Shovel a dead lettered message to an active queue.
  2. When it comes back, the timestamp from the time-value is chopped off, resulting in an invalid timestamp

Expected behavior

The time value should behave like it is stated in the documentation: "When this message was dead lettered the first time from this queue for this reason." https://www.rabbitmq.com/docs/dlx

Additional context

__TypeId__: our.type
x-death:    
count:  1
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   1731593401

__TypeId__: our.type
x-death:    
count:  2
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   1731579

__TypeId__: our.type
x-death:    
count:  3
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   1731

__TypeId__: our.type
x-death:    
count:  4
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   1

__TypeId__: our.type
x-death:    
count:  5
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   0
__TypeId__: our.type
x-death:    
count:  6
exchange:   our.exchange
queue:  our.queue
reason: rejected
routing-keys:   
time:   0

As you can see, after every retry the time value is chopped off by 3 digits, until it is 0. After the first retry, we still have a valid timestamp: "1731593401"

➜  ~ date -r 1731593401
Do 14 Nov 2024 15:10:01 CET

But after the second try the timestamp doesn't make any sense.

➜  ~ date -r 1731579
Mi 21 Jan 1970 01:59:39 CET
ansd commented 6 days ago

@Alex-The-DevOp-Guy please include the RabbitMQ version and list or enabled feature flags where you observe this issue.