Skip to content

Instantly share code, notes, and snippets.

@markllama
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markllama/e0a5db776d2a1c876ff6 to your computer and use it in GitHub Desktop.
Save markllama/e0a5db776d2a1c876ff6 to your computer and use it in GitHub Desktop.
Test QPID echo
#!/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