From a753a0f8d2770b7400664898cec598db618f01e0 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Wed, 17 Feb 2010 20:06:44 +0000 Subject: added a subject option to spout git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@911163 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/examples/api/spout | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qpid/python/examples/api') diff --git a/qpid/python/examples/api/spout b/qpid/python/examples/api/spout index 5479b66211..9606c3501f 100755 --- a/qpid/python/examples/api/spout +++ b/qpid/python/examples/api/spout @@ -48,6 +48,7 @@ parser.add_option("-c", "--count", type=int, default=1, parser.add_option("-t", "--timeout", type=float, default=None, help="exit after the specified time") parser.add_option("-i", "--id", help="use the supplied id instead of generating one") +parser.add_option("-S", "--subject", help="specify a subject") parser.add_option("-R", "--reply-to", help="specify reply-to address") parser.add_option("-P", "--property", dest="properties", action="append", default=[], metavar="NAME=VALUE", help="specify message property") @@ -107,7 +108,9 @@ try: start = time.time() while (opts.count == 0 or count < opts.count) and \ (opts.timeout is None or time.time() - start < opts.timeout): - msg = Message(content, reply_to=opts.reply_to) + msg = Message(subject=opts.subject, + reply_to=opts.reply_to, + content=content) msg.properties["spout-id"] = "%s:%s" % (spout_id, count) for p in opts.properties: name, val = nameval(p) -- cgit v1.2.1