Created
June 27, 2014 04:09
-
-
Save skillachie/7e0f4c50b6ccbd380179 to your computer and use it in GitHub Desktop.
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