Last active
August 29, 2015 14:05
-
-
Save markllama/e0a5db776d2a1c876ff6 to your computer and use it in GitHub Desktop.
Test QPID echo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from qpid.messaging import * | |
broker = sys.argv[1] + ":5672" | |
address = "amq.topic" | |
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 | |
finally: | |
connection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment