From 68783a1cdf1936271cab221d150699e958dfb648 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Tue, 16 Feb 2010 21:14:38 +0000 Subject: 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 --- qpid/extras/qmf/src/py/qmf/console.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'qpid') 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() -- cgit v1.2.1