Skip to content

Files

This branch is 1017 commits behind rabbitmq/rabbitmq-tutorials:main.

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 20, 2011
Mar 14, 2011
Mar 14, 2011
Mar 14, 2011
Apr 14, 2011
Mar 14, 2011
Mar 14, 2011
Mar 14, 2011
Mar 14, 2011
Aug 24, 2011
May 18, 2011
Mar 14, 2011
Mar 29, 2011

Python code for RabbitMQ tutorials

Here you can find Python code examples from RabbitMQ tutorials.

To successfully use the examples you will need a running RabbitMQ server.

Requirements

To run this code you need pika library version 0.9.5. To install it run

pip install pika==0.9.5

You may first need to run

easy_install pip

Code

Tutorial one: "Hello World!":

python send.py
python receive.py

Tutorial two: Work Queues:

python new_task.py "A very hard task which takes two seconds.."
python worker.py

Tutorial three: Publish/Subscribe:

python receive_logs.py
python emit_log.py "info: This is the log message"

Tutorial four: Routing:

python receive_logs_direct.py info
python emit_log_direct.py info "The message"

Tutorial five: Topics:

python receive_logs_topic.py "*.rabbit"
python emit_log_topic.py red.rabbit Hello

Tutorial six: RPC:

python rpc_server.py
python rpc_client.py