diff options
| author | Ted Ross <tross@apache.org> | 2010-02-16 21:14:38 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2010-02-16 21:14:38 +0000 |
| commit | 3ac9a5381eac2138c1e52d00831930e73fa27f82 (patch) | |
| tree | 4d693b4fc4626703eeaa9cd670e321b196c05984 /extras | |
| parent | 3ef48643451e016a4dff034bfee606c189592467 (diff) | |
| download | qpid-python-3ac9a5381eac2138c1e52d00831930e73fa27f82.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/qpid@910694 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'extras')
| -rw-r--r-- | extras/qmf/src/py/qmf/console.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extras/qmf/src/py/qmf/console.py b/extras/qmf/src/py/qmf/console.py index 45004716a8..b663116f40 100644 --- a/extras/qmf/src/py/qmf/console.py +++ b/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() |
