qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r903410 - in /qpid/trunk/qpid/python/qpid: driver.py tests/messaging.py
Date Tue, 26 Jan 2010 20:53:33 GMT
Author: rhs
Date: Tue Jan 26 20:53:24 2010
New Revision: 903410

URL: http://svn.apache.org/viewvc?rev=903410&view=rev
Log:
fixed subject override

Modified:
    qpid/trunk/qpid/python/qpid/driver.py
    qpid/trunk/qpid/python/qpid/tests/messaging.py

Modified: qpid/trunk/qpid/python/qpid/driver.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/driver.py?rev=903410&r1=903409&r2=903410&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/driver.py (original)
+++ qpid/trunk/qpid/python/qpid/driver.py Tue Jan 26 20:53:24 2010
@@ -839,11 +839,10 @@
     sst = self._attachments[snd.session]
     _snd = self._attachments[snd]
 
-    # XXX: what if subject is specified for a normal queue?
-    if _snd._routing_key is None:
-      rk = msg.subject
-    else:
+    if msg.subject is None or _snd._exchange == "":
       rk = _snd._routing_key
+    else:
+      rk = msg.subject
     # XXX: do we need to query to figure out how to create the reply-to interoperably?
     if msg.reply_to:
       rt = addr2reply_to(msg.reply_to)

Modified: qpid/trunk/qpid/python/qpid/tests/messaging.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/messaging.py?rev=903410&r1=903409&r2=903410&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/tests/messaging.py (original)
+++ qpid/trunk/qpid/python/qpid/tests/messaging.py Tue Jan 26 20:53:24 2010
@@ -765,6 +765,17 @@
     snd_b.send(m4)
     self.drain(rcv, expected=[m3, m4])
 
+  def testSubjectOverride(self):
+    snd = self.ssn.sender("amq.topic/a")
+    rcv_a = self.ssn.receiver("amq.topic/a")
+    rcv_b = self.ssn.receiver("amq.topic/b")
+    m1 = self.content("testSubjectOverride", 1)
+    m2 = self.content("testSubjectOverride", 2)
+    snd.send(m1)
+    snd.send(Message(subject="b", content=m2))
+    self.drain(rcv_a, expected=[m1])
+    self.drain(rcv_b, expected=[m2])
+
 NOSUCH_Q = "this-queue-should-not-exist"
 UNPARSEABLE_ADDR = "name/subject; {bad options"
 UNLEXABLE_ADDR = "\0x0\0x1\0x2\0x3"



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


Mime
View raw message