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 | c3b903579b10d3eaaad41a0f9b5351fa955f2528 (patch) | |
tree | afb52c5cad7483cd721a51773d5d998e713e90d2 /python/examples/api | |
parent | 9813d6c994da68f8fc5387826054eb454a2ba50a (diff) | |
download | qpid-python-c3b903579b10d3eaaad41a0f9b5351fa955f2528.tar.gz |
added a subject option to spout
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@911163 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/api')
-rwxr-xr-x | python/examples/api/spout | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/examples/api/spout b/python/examples/api/spout index 5479b66211..9606c3501f 100755 --- a/python/examples/api/spout +++ b/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) |