diff options
author | Mehdi Abaakouk <mehdi.abaakouk@enovance.com> | 2014-12-03 14:35:04 +0100 |
---|---|---|
committer | Mehdi Abaakouk <mehdi.abaakouk@enovance.com> | 2015-03-02 17:52:38 +0100 |
commit | 0359147713c4a1e4b77fce60ad45c367f70f0059 (patch) | |
tree | 1a128eb68a190824d5cfd4589042e6a42a43b9bc | |
parent | 097fb235b2a2de216d591ea9cf674b7ceeab4b06 (diff) | |
download | oslo-messaging-0359147713c4a1e4b77fce60ad45c367f70f0059.tar.gz |
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
-rw-r--r-- | oslo_messaging/_drivers/impl_rabbit.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index c66daf7..b06d290 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) |