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
This commit is contained in:
Mark McLoughlin 2014-03-18 07:17:49 +00:00
parent 5f5501f534
commit d5dcfe91db
1 changed files with 7 additions and 3 deletions

View File

@ -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)