![]() style: sort imports & format parameters onto separate lines for better clarity Format all python files using `black` |
||
---|---|---|
.. | ||
emit_log_direct.py | ||
emit_log_topic.py | ||
emit_log.py | ||
new_task.py | ||
README.md | ||
receive_logs_direct.py | ||
receive_logs_topic.py | ||
receive_logs.py | ||
receive.py | ||
rpc_client.py | ||
rpc_server.py | ||
send.py | ||
worker.py |
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 to install the pika
package version 1.0.0
or later. To install it, run
python -m pip install pika
You may first need to run
easy_install pip
Code
python send.py
python receive.py
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"
python receive_logs_direct.py info
python emit_log_direct.py info "The message"
python receive_logs_topic.py "*.rabbit"
python emit_log_topic.py red.rabbit Hello
python rpc_server.py
python rpc_client.py