diff options
author | Rafael H. Schloming <rhs@apache.org> | 2010-02-17 20:06:44 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2010-02-17 20:06:44 +0000 |
commit | a753a0f8d2770b7400664898cec598db618f01e0 (patch) | |
tree | c4ec9a0fb69c7ebc8da34527925ab2aaab05a901 | |
parent | a8b1bbd8fc369dc5e4915c65627d4778bb870212 (diff) | |
download | qpid-python-a753a0f8d2770b7400664898cec598db618f01e0.tar.gz |
added a subject option to spout
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@911163 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | qpid/python/examples/api/spout | 5 |
1 files changed, 4 insertions, 1 deletions
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) |