summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ross <jross@apache.org>2013-04-23 21:16:04 +0000
committerJustin Ross <jross@apache.org>2013-04-23 21:16:04 +0000
commit3b0c3eb1c32102f65e4b63945c90bf4e706aa200 (patch)
treea7173c9269e78afa55a4019746c7fe98b4e41a8a
parentd13bcd994e89bb4c2e53ff1c5b05f3645511a7dd (diff)
downloadqpid-python-3b0c3eb1c32102f65e4b63945c90bf4e706aa200.tar.gz
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
-rwxr-xr-xqpid/python/examples/api/spout6
1 files changed, 6 insertions, 0 deletions
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)