You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2013/04/23 23:16:04 UTC

svn commit: r1471146 - /qpid/trunk/qpid/python/examples/api/spout

Author: jross
Date: Tue Apr 23 21:16:04 2013
New Revision: 1471146

URL: http://svn.apache.org/r1471146
Log:
QPID-4772: Assume text/plain for content type if no other indication is given; a patch from Ernie Allen

Modified:
    qpid/trunk/qpid/python/examples/api/spout

Modified: qpid/trunk/qpid/python/examples/api/spout
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/examples/api/spout?rev=1471146&r1=1471145&r2=1471146&view=diff
==============================================================================
--- qpid/trunk/qpid/python/examples/api/spout (original)
+++ qpid/trunk/qpid/python/examples/api/spout Tue Apr 23 21:16:04 2013
@@ -75,6 +75,7 @@ else:
   parser.error("address is required")
 
 content = None
+content_type = None
 
 if args:
   text = " ".join(args)
@@ -90,6 +91,9 @@ if opts.entries:
     content[name] = val
 else:
   content = text
+  # no entries were supplied, so assume text/plain for
+  # compatibility with java (and other) clients
+  content_type = "text/plain"
 
 conn = Connection(opts.broker,
                   reconnect=opts.reconnect,
@@ -107,6 +111,8 @@ try:
     msg = Message(subject=opts.subject,
                   reply_to=opts.reply_to,
                   content=content)
+    if content_type is not None:
+        msg.content_type = content_type
     msg.properties["spout-id"] = "%s:%s" % (spout_id, count)
     for p in opts.properties:
       name, val = nameval(p)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org