Commit e1df4f23 authored by AVPetukhov's avatar AVPetukhov
Browse files

Upload New File

parent 1c2807f5
import pika, sys, os
def main():
credentials = pika.PlainCredentials('Anton', 'Anton')
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='217.9.89.214', port=5672, virtual_host='/', credentials=credentials))
channel = connection.channel()
channel.queue_declare(queue='Anton')
def callback(ch, method, properties, body):
print("Received %r" % body)
channel.basic_consume(queue='Anton', on_message_callback=callback, auto_ack=True)
print('Waiting for messages. To exit press CTRL+C')
channel.start_consuming()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print('Interrupted')
try:
sys.exit(0)
except SystemExit:
os._exit(0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment