Created
June 27, 2014 04:09
This file contains 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/env python | |
import pika | |
import sys | |
#Example publisher code take from RabbitMQ topic tutorial | |
routing_key = sys.argv[1] if len(sys.argv) > 1 else 'anonymous.info' | |
message = ' '.join(sys.argv[2:]) or 'Hello World!' | |
channel.basic_publish(exchange='data_gateway', | |
routing_key=routing_key, | |
body=message, | |
properties=pika.BasicProperties(delivery_mode =2,)) | |
print " [x] Sent %r:%r" % (routing_key, message) | |
connection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment