summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJonathan Robie <jonathan@apache.org>2011-01-07 19:44:02 +0000
committerJonathan Robie <jonathan@apache.org>2011-01-07 19:44:02 +0000
commitba444bec10b0d84b81245eae06962326d1c5f82c (patch)
treea5defdf0fe85914241b552c7ea7ec8a4beb40739 /python
parent6dc6cfd7718d3758d0d6e3b16f52542c1b4ac369 (diff)
downloadqpid-python-ba444bec10b0d84b81245eae06962326d1c5f82c.tar.gz
Eliminates duplicate ExchangeBind when x-bindings are present.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1056473 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/messaging/driver.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index f6378c39ea..2eb2c1863e 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -82,6 +82,7 @@ class Pattern:
# XXX: this should become part of the driver
def _bind(self, sst, exchange, queue):
from qpid.ops import ExchangeBind
+
sst.write_cmd(ExchangeBind(exchange=exchange, queue=queue,
binding_key=self.value.replace("*", "#")))
@@ -244,8 +245,10 @@ class LinkIn:
overrides=declare)
_rcv.on_unlink = [QueueDelete(_rcv._queue)]
subject = _rcv.subject or SUBJECT_DEFAULTS.get(subtype)
- sst.write_cmd(ExchangeBind(_rcv._queue, _rcv.name, subject))
bindings = get_bindings(link_opts, _rcv._queue, _rcv.name, subject)
+ if not bindings:
+ sst.write_cmd(ExchangeBind(_rcv._queue, _rcv.name, subject))
+
elif type == "queue":
_rcv._queue = _rcv.name
if _rcv.options.get("mode", "consume") == "browse":