Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X-Delay header is mangled on receipt (signed/unsigned integer issue) #438

Open
cjsoftuk opened this issue Oct 29, 2024 · 0 comments
Open

Comments

@cjsoftuk
Copy link

As per https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq, if you use the delayed exchange, and set the x-delay header, the headers when it is received by the application on the other end (also using py-amqp), the header becomes mangled as it is negated when it is sent via the delayed exchange to confirm it was delayed (see https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq#checking-if-a-message-was-delayed).

Take the following headers on a message (for example):

{'x-retries': 3, 'x-delay': 1000}

Upon receipt on the other side of RabbitMQ, py-amqp shows these as

{'x-delay': 18446744073709550616, 'x-retries': 3}

X-Delay is, indeed, -1000, if you look at it as a signed integer. It appears the library sees it as an unsigned integer and therefore produces a potentially catastrophically incorrect answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant