diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2008-12-09 21:24:51 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2008-12-09 21:24:51 +0000 |
| commit | 776aa03e340e3cb753bd56dea363caa44b866640 (patch) | |
| tree | 5673d5e5cc8a2cc2257832620035b3b8e055dc7d /qpid/python | |
| parent | 5259f55963e7e58643d72770c64fc4db18eed219 (diff) | |
| download | qpid-python-776aa03e340e3cb753bd56dea363caa44b866640.tar.gz | |
modified hello-world to optionally take a broker as an argument
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@724898 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rwxr-xr-x | qpid/python/hello-world | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/qpid/python/hello-world b/qpid/python/hello-world index 5d312e7371..efee84059c 100755 --- a/qpid/python/hello-world +++ b/qpid/python/hello-world @@ -17,12 +17,23 @@ # specific language governing permissions and limitations # under the License. # +import sys from qpid.connection import Connection from qpid.util import connect from qpid.datatypes import uuid4, Message +broker = "127.0.0.1" +port = 5672 + +if len(sys.argv) > 1: broker = sys.argv[1] +if len(sys.argv) > 2: port = int(sys.argv[2]) + +if len(sys.argv) > 3: + print >> sys.stderr, "usage: hello-world [ <broker> [ <port> ] ]" + sys.exit(1) + # connect to the server and start a session -conn = Connection(connect("127.0.0.1", 5672)) +conn = Connection(connect(broker, port)) conn.start() ssn = conn.session(str(uuid4())) |
