/ rabbitmq-tutorials Public
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
rabbitmq-tutorials/python/receive.pyGo to file
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
|import pika, sys, os|
|connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))|
|channel = connection.channel()|
|def callback(ch, method, properties, body):|
|print(" [x] Received %r" % body.decode())|
|channel.basic_consume(queue='hello', on_message_callback=callback, auto_ack=True)|
|print(' [*] Waiting for messages. To exit press CTRL+C')|
|if __name__ == '__main__':|