import sys
from qpid.messaging import *
if len(sys.argv)<2:
broker = "localhost:5672"
else:
broker = sys.argv[1]
if len(sys.argv)<3:
address = "amq.topic"
else:
address = sys.argv[2]
connection = Connection(broker)
try:
connection.open()
session = connection.session()
sender = session.sender(address)
receiver = session.receiver(address)
sender.send(Message("Hello world!"));
message = receiver.fetch()
print message.content
session.acknowledge()
except MessagingError,m:
print m
connection.close()
Apache Qpid, Messaging built on AMQP; Copyright © 2015 The Apache Software Foundation; Licensed under the Apache License, Version 2.0; Apache Qpid, Qpid, Qpid Proton, Proton, Apache, the Apache feather logo, and the Apache Qpid project logo are trademarks of The Apache Software Foundation; All other marks mentioned may be trademarks or registered trademarks of their respective owners