From 3b0c3eb1c32102f65e4b63945c90bf4e706aa200 Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Tue, 23 Apr 2013 21:16:04 +0000 Subject: QPID-4772: Assume text/plain for content type if no other indication is given; a patch from Ernie Allen git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1471146 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/examples/api/spout | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qpid/python/examples/api/spout b/qpid/python/examples/api/spout index c2dc4db380..e4d7cfb970 100755 --- a/qpid/python/examples/api/spout +++ b/qpid/python/examples/api/spout @@ -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) -- cgit v1.2.1