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

auto_delete argument to Exchange only works with pyamqp #296

Closed
rascalking opened this issue Dec 30, 2013 · 4 comments
Closed

auto_delete argument to Exchange only works with pyamqp #296

rascalking opened this issue Dec 30, 2013 · 4 comments

Comments

@rascalking
Copy link

Trying to track down a problem where the same rabbitmq Exchange declaration, imported into two separate programs, was throwing a 406 PRECONDITION_FAILED error. It turns out that since one of them was using gevent, it was using pyamqp. The other was using librabbitmq. And for some reason, librabbitmq seems to be ignoring the auto_delete argument.

exchange = Exchange('exchange_test', type='fanout',
                    auto_delete=True, delivery_mode='transient', durable=False)
queue = Queue('queue_test_{}'.format(uuid.uuid4().hex),
              exchange, durable=False, auto_delete=True, no_ack=True)

with Connection('amqp://guest:guest@localhost:5672//') as connection:
    try:
        with connection.Consumer(queues=queue, callbacks=[print_body],
                                 no_ack=True, auto_declare=True) as consumer:
            consumer.consume(no_ack=True)
            connection.drain_events()
@ask
Copy link
Contributor

ask commented Jan 13, 2014

Right, the rabbitmq-c library removed support of auto_delete for reasons unknown as it was previously supported. Not sure what the python client can do about it :/

@ask
Copy link
Contributor

ask commented Jan 13, 2014

This should shed some light on this:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-July/013708.html

So the auto_delete argument to exchange_declare was removed in AMQP 0.9.1,
which means that py-amqp should deprecate it (we cannot just remove it for backwards compatibility).

@ask
Copy link
Contributor

ask commented Jan 13, 2014

Oh, auto_delete is already deprecated in amqp but the warning is a normal DeprecationWarning so is not seen in program output. I will replace that with a custom deprecation warning class so that users will actually see it.

@rascalking
Copy link
Author

Makes sense. Thanks for the explanation!

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