From 0359147713c4a1e4b77fce60ad45c367f70f0059 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Wed, 3 Dec 2014 14:35:04 +0100 Subject: [PATCH] NotifyPublisher need handle amqp_auto_delete Notifypublisher and TopicConsumer must create the exchange and the queue with the same parameters otherwise kombu raises a 'PreconditionFailed' error. But when cfg.CONF.amqp_auto_delete = True, this is not the case. This change ensures that amqp_auto_delete correclty set when cfg.CONF.amqp_auto_delete = True. Closes bug: #1366597 Change-Id: I8c661deae82bcf2ae2e114621e69e0c7ae2a0a69 --- oslo_messaging/_drivers/impl_rabbit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index c66daf7e..b06d290a 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -439,6 +439,7 @@ class NotifyPublisher(TopicPublisher): def __init__(self, conf, channel, exchange_name, topic, **kwargs): self.durable = kwargs.pop('durable', conf.amqp_durable_queues) + self.auto_delete = kwargs.pop('auto_delete', conf.amqp_auto_delete) self.queue_arguments = _get_queue_arguments(conf) super(NotifyPublisher, self).__init__(conf, channel, exchange_name, topic, **kwargs) @@ -452,6 +453,7 @@ class NotifyPublisher(TopicPublisher): queue = kombu.entity.Queue(channel=channel, exchange=self.exchange, durable=self.durable, + auto_delete=self.auto_delete, name=self.routing_key, routing_key=self.routing_key, queue_arguments=self.queue_arguments)