From d5dcfe91db29dc8e77fd0c06b7edfe4ec9887ad7 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 18 Mar 2014 07:17:49 +0000 Subject: [PATCH] Use driver's notify_send() method again Drivers have a notify_send() method which allows for special semantics to be implemented for notification sending. During the port over to oslo.messaging, it appears we stopped using this and switched to just using topic_send() instead. Lets restore the use of notify_send() so that we don't lose behaviours like I9f8dfd6eaf3996be58fecff6ad91508bdcef23f3 added. Change-Id: Id0ad0431d3e2b1bfe21723e7f3b1842c2d3a9546 --- oslo/messaging/_drivers/amqpdriver.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/oslo/messaging/_drivers/amqpdriver.py b/oslo/messaging/_drivers/amqpdriver.py index b8b9fcefe..3a2303d39 100644 --- a/oslo/messaging/_drivers/amqpdriver.py +++ b/oslo/messaging/_drivers/amqpdriver.py @@ -358,7 +358,8 @@ class AMQPDriverBase(base.BaseDriver): return self._reply_q def _send(self, target, ctxt, message, - wait_for_reply=None, timeout=None, envelope=True): + wait_for_reply=None, timeout=None, + envelope=True, notify=False): # FIXME(markmc): remove this temporary hack class Context(object): @@ -388,7 +389,9 @@ class AMQPDriverBase(base.BaseDriver): try: with self._get_connection() as conn: - if target.fanout: + if notify: + conn.notify_send(target.topic, msg) + elif target.fanout: conn.fanout_send(target.topic, msg) else: topic = target.topic @@ -409,7 +412,8 @@ class AMQPDriverBase(base.BaseDriver): return self._send(target, ctxt, message, wait_for_reply, timeout) def send_notification(self, target, ctxt, message, version): - return self._send(target, ctxt, message, envelope=(version == 2.0)) + return self._send(target, ctxt, message, + envelope=(version == 2.0), notify=True) def listen(self, target): conn = self._get_connection(pooled=False)