summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-02-16 21:14:38 +0000
committerTed Ross <tross@apache.org>2010-02-16 21:14:38 +0000
commit68783a1cdf1936271cab221d150699e958dfb648 (patch)
tree7f53ded3c943a5d60608dd6e885442cbfca64aae
parent6e0a80b089cb3e19061297b1b3b446cfa2bbb9b4 (diff)
downloadqpid-python-68783a1cdf1936271cab221d150699e958dfb648.tar.gz
Handle the case where a message is received without a routing_key in the delivery properties.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@910694 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/extras/qmf/src/py/qmf/console.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/qpid/extras/qmf/src/py/qmf/console.py b/qpid/extras/qmf/src/py/qmf/console.py
index 45004716a8..b663116f40 100644
--- a/qpid/extras/qmf/src/py/qmf/console.py
+++ b/qpid/extras/qmf/src/py/qmf/console.py
@@ -858,10 +858,16 @@ class Session:
dp = msg.get("delivery_properties")
if dp:
key = dp["routing_key"]
- keyElements = key.split(".")
- if len(keyElements) == 4:
- brokerBank = int(keyElements[2])
- agentBank = int(keyElements[3])
+ if key:
+ keyElements = key.split(".")
+ if len(keyElements) == 4:
+ brokerBank = int(keyElements[2])
+ agentBank = int(keyElements[3])
+ else:
+ # If there's no routing key in the delivery properties,
+ # assume the message is from the broker.
+ brokerBank = 1
+ agentBank = 0
agent = broker.getAgent(brokerBank, agentBank)
timestamp = codec.read_uint64()