mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.18k stars 186 forks source link

x-max-priority is limited to 127 instead of 255 #333

Open rkissos opened 4 years ago

rkissos commented 4 years ago

Declaring a queue with the following arguments: {'x-max-priority': 255} raises:

../../lala/utils/rabbitmq.py:160: in _declare_tasks_queue
    arguments=self.queue_arguments)
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aio_pika/robust_channel.py:173: in declare_queue
    timeout=timeout,
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aio_pika/channel.py:303: in declare_queue
    await queue.declare(timeout=timeout)
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aio_pika/queue.py:101: in declare
    timeout=timeout,
../../../../anaconda3/envs/lala/lib/python3.7/asyncio/tasks.py:388: in wait_for
    return await fut
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aiormq/channel.py:641: in queue_declare
    arguments=arguments,
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aiormq/base.py:168: in wrap
    return await self.create_task(func(self, *args, **kwargs))
../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aiormq/base.py:27: in __inner
    raise self.exception from e
../../../../anaconda3/envs/lala/lib/python3.7/asyncio/tasks.py:603: in _wrap_awaitable
    return (yield from awaitable.__await__())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <TaskWrapper: <Task cancelled coro=<Channel.rpc() done, defined at /Users/kenny/anaconda3/envs/lala/lib/python3.7/site-packages/aiormq/channel.py:101>>>

    async def __inner(self):
        try:
            return await self.task
        except asyncio.CancelledError as e:
>           raise self.exception from e
E           aiormq.exceptions.ChannelPreconditionFailed: PRECONDITION_FAILED - invalid arg 'x-max-priority' for queue 'test' in vhost 'my_vhost': {value_negative,-1}

../../../../anaconda3/envs/lala/lib/python3.7/site-packages/aiormq/base.py:27: ChannelPreconditionFailed

aio-pika version 6.6.1 rabbitmq version 3.8.5

aamalev commented 4 years ago

pamqp.encode.DEPRECATED_RABBITMQ_SUPPORT = True

rtplv commented 3 years ago

The same problem.

aiormq.exceptions.ChannelPreconditionFailed: PRECONDITION_FAILED - inequivalent arg 'x-max-priority' for queue 'test' in vhost '/': received '-1' but current is '255'