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

If value passed to the queue_declare arguments is int and greater then 128 then server reply that value was negative #85

Closed
lemurchik opened this issue Apr 23, 2020 · 2 comments

Comments

@lemurchik
Copy link

How reproduce

Code:

import asyncio

import aiormq


async def test():
    connection = await aiormq.connect("amqp://guest:guest@localhost/")

    keys = {'x-max-length', 'x-message-ttl', 'x-max-length', 'x-max-length-bytes'}
    for k in keys:
        channel = await connection.channel()
        try:
            await channel.queue_declare('test', arguments={k: 129})
        except Exception as e:
            print(e)


asyncio.run(test())

Result:

PRECONDITION_FAILED - invalid arg 'x-max-length-bytes' for queue 'test' in vhost '/': {value_negative,-127}
PRECONDITION_FAILED - invalid arg 'x-message-ttl' for queue 'test' in vhost '/': {value_negative,-127}
PRECONDITION_FAILED - invalid arg 'x-max-length' for queue 'test' in vhost '/': {value_negative,-127}

Environment

OS: Ubuntu 19.10
Python: 3.7.5
Package version: aiormq==3.2.1
RabbitMQ: 3.8.3, Erlang 22.3

Similar bug in another library:
Polyconseil/aioamqp#204

@mosquito
Copy link
Owner

I'm sorry but that is the wrong library to fix it. The bug actually here.

@lemurchik
Copy link
Author

Yep, will report there if it's not fixed yet

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

2 participants