.. | ||
01-hello-world | ||
02-work-queues | ||
03-publish-subscribe | ||
04-routing | ||
05-topics | ||
.gitignore | ||
README.md |
Rust code for RabbitMQ tutorials
Here you can find the Rust code examples for RabbitMQ tutorials.
The examples use lapin client library.
You should have a RabbitMQ server running on default port.
Requirements
Code
Each tutorial is a separate crate where each source file corresponds to a binary executable. Each cargo command should be launched in a separate shell.
Tutorial one: "Hello World!"
cd 01-hello-world
cargo run --bin receive
cargo run --bin send
Tutorial two: Work Queues
cd 02-work-queues
cargo run --bin worker
cargo run --bin new-task "hi" # specify a custom message
Tutorial three: Publish/Subscribe
cd 03-publish-subscribe
cargo run --bin subscribe
cargo run --bin publish "hi" # specify a custom message
Tutorial four: Routing
cd 04-routing
cargo run --bin receive-direct info error # specify log levels
cargo run --bin emit-direct error "help!" # specify severity and custom message
Tutorial five: Topics
cd 05-topics
cargo run --bin receive-topic kern.* # specify topic filter
cargo run --bin emit-topic kern.mem "No memory left!" # specify topic and message