You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2010/02/17 21:06:44 UTC

svn commit: r911163 - /qpid/trunk/qpid/python/examples/api/spout

Author: rhs
Date: Wed Feb 17 20:06:44 2010
New Revision: 911163

URL: http://svn.apache.org/viewvc?rev=911163&view=rev
Log:
added a subject option to spout

Modified:
    qpid/trunk/qpid/python/examples/api/spout

Modified: qpid/trunk/qpid/python/examples/api/spout
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/examples/api/spout?rev=911163&r1=911162&r2=911163&view=diff
==============================================================================
--- qpid/trunk/qpid/python/examples/api/spout (original)
+++ qpid/trunk/qpid/python/examples/api/spout Wed Feb 17 20:06:44 2010
@@ -48,6 +48,7 @@
 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 @@
   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)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org