qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [qpid-proton] 02/02: PROTON-1986: [Python] Make example broker work with anonymous links - If you receive a message on a link with no target address then use the message address
Date Thu, 20 Dec 2018 04:16:49 GMT
This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit ffe4915f609e1afe901d8cea7c38d3c0b83daa6e
Author: Andrew Stitcher <astitcher@apache.org>
AuthorDate: Wed Dec 19 22:56:26 2018 -0500

    PROTON-1986: [Python] Make example broker work with anonymous links
    - If you receive a message on a link with no target address then use the message address
---
 python/examples/broker.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/examples/broker.py b/python/examples/broker.py
index bbbd4f9..67eb216 100755
--- a/python/examples/broker.py
+++ b/python/examples/broker.py
@@ -112,7 +112,10 @@ class Broker(MessagingHandler):
         self._queue(event.link.source.address).dispatch(event.link)
 
     def on_message(self, event):
-        self._queue(event.link.target.address).publish(event.message)
+        address = event.link.target.address
+        if address is None:
+            address = event.message.address
+        self._queue(address).publish(event.message)
 
 parser = optparse.OptionParser(usage="usage: %prog [options]")
 parser.add_option("-a", "--address", default="localhost:5672",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message