You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2010/02/16 22:14:39 UTC

svn commit: r910694 - /qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py

Author: tross
Date: Tue Feb 16 21:14:38 2010
New Revision: 910694

URL: http://svn.apache.org/viewvc?rev=910694&view=rev
Log:
Handle the case where a message is received without a routing_key in the delivery properties.

Modified:
    qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py

Modified: qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py?rev=910694&r1=910693&r2=910694&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py (original)
+++ qpid/trunk/qpid/extras/qmf/src/py/qmf/console.py Tue Feb 16 21:14:38 2010
@@ -858,10 +858,16 @@
     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()



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org