Author: rhs
Date: Thu Mar 6 07:05:04 2008
New Revision: 634289
URL: http://svn.apache.org/viewvc?rev=634289&view=rev
Log:
preliminary support for message headers
Modified:
incubator/qpid/trunk/qpid/python/hello-010-world
incubator/qpid/trunk/qpid/python/qpid/session.py
incubator/qpid/trunk/qpid/python/server010
Modified: incubator/qpid/trunk/qpid/python/hello-010-world
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/hello-010-world?rev=634289&r1=634288&r2=634289&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/hello-010-world (original)
+++ incubator/qpid/trunk/qpid/python/hello-010-world Thu Mar 6 07:05:04 2008
@@ -22,8 +22,10 @@
ssn.queue_declare("asdf")
+
ssn.message_transfer("this", None, None, Message("testing..."))
-ssn.message_transfer("is", None, None, Message("more testing..."))
+props = ssn.delivery_properties(routing_key="asdf")
+ssn.message_transfer("is", None, None, Message(props, "more testing..."))
ssn.message_transfer("a")
ssn.message_transfer("test")
Modified: incubator/qpid/trunk/qpid/python/qpid/session.py
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/session.py?rev=634289&r1=634288&r2=634289&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/session.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/session.py Thu Mar 6 07:05:04 2008
@@ -73,9 +73,17 @@
if cmd is not None and cmd.track == self.spec["track.command"].value:
return cmd
else:
+ # XXX
+ for st in self.spec.structs.values():
+ if st.name == name:
+ return st
return None
def invoke(self, type, args, kwargs):
+ # XXX
+ if not hasattr(type, "track"):
+ return type.new(args, kwargs)
+
if self.channel == None:
raise SessionDetached()
@@ -106,7 +114,7 @@
if message.headers != None:
sc = StringCodec(self.spec)
for st in message.headers:
- sc.write_struct32(st.type, st)
+ sc.write_struct32(st)
seg = Segment(False, message.body == None,
self.spec["segment_type.header"].value,
type.track, self.channel.id, sc.encoded)
self.send(seg)
Modified: incubator/qpid/trunk/qpid/python/server010
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/server010?rev=634289&r1=634288&r2=634289&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/server010 (original)
+++ incubator/qpid/trunk/qpid/python/server010 Thu Mar 6 07:05:04 2008
@@ -28,9 +28,9 @@
def queue_query(self, qq):
return qq.type.result.type.new((qq.queue,), {})
- def message_transfer(self, cmd, header, body):
+ def message_transfer(self, cmd, headers, body):
m = Message(body)
- m.header = header
+ m.headers = headers
self.session.message_transfer(cmd.destination, cmd.accept_mode,
cmd.acquire_mode, m)
def message_accept(self, messages):