Skip to content

Commit 171239a

Browse files
Begin porting Rust tutorials to amqprs (in addition to Lapin)
1 parent 21c8429 commit 171239a

20 files changed

+360
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ The following ports are available:
4747
* [Perl](./perl)
4848
* [Python (with Pika)](./python)
4949
* [Ruby (with Bunny)](./ruby)
50-
* [Rust](./rust)
50+
* [Rust with amqprs](./rust-amqprs)
51+
* [Rust with Lapin](./rust-lapin)
5152
* [Scala](./scala)
5253
* [Swift](./swift)
5354
* [Spring AMQP](./spring-amqp)

rust-amqprs/Cargo.lock

Lines changed: 302 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-amqprs/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "rabbitmq-tutorials"
3+
version = "1.0.0"
4+
authors = ["Michael Klishin <[email protected]>"]
5+
edition = "2021"
6+
7+
[dependencies]
8+
amqprs = "1.2"
9+
tokio = "1"

rust-amqprs/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Rust code for RabbitMQ tutorials (using amqprs)
2+
3+
Here you can find the Rust code examples for [RabbitMQ
4+
tutorials](https://www.rabbitmq.com/getstarted.html).
5+
6+
The examples use [amqprs](https://github.com/gftea/amqprs) client library.
7+
8+
These tutorials assume a RabbitMQ server node running locally using default ports.
9+
10+
## Requirements
11+
12+
* [Rust and Cargo](https://www.rust-lang.org/tools/install)
13+
14+
## Code
15+
Each cargo command should be launched in a separate shell.
16+
17+
#### [Tutorial one: "Hello World!"](https://www.rabbitmq.com/tutorials/tutorial-one-python.html)
18+
19+
cargo run --bin receive
20+
cargo run --bin send
21+
22+
#### [Tutorial two: Work Queues](https://www.rabbitmq.com/tutorials/tutorial-two-python.html)
23+
24+
cargo run --bin worker
25+
cargo run --bin new_task "hi" # specify a custom message
26+
27+
#### [Tutorial three: Publish/Subscribe](https://www.rabbitmq.com/tutorials/tutorial-three-python.html)
28+
29+
cargo run --bin receive_logs
30+
cargo run --bin emit_log "hi" # specify a custom message
31+
32+
#### [Tutorial four: Routing](https://www.rabbitmq.com/tutorials/tutorial-four-python.html)
33+
34+
cargo run --bin receive_logs_direct info error # specify log levels
35+
cargo run --bin emit_log_direct error "help!" # specify severity and custom message
36+
37+
#### [Tutorial five: Topics](https://www.rabbitmq.com/tutorials/tutorial-five-python.html)
38+
39+
cargo run --bin receive_logs_topic kern.* # specify topic filter
40+
cargo run --bin emit_log_topic kern.mem "No memory left!" # specify topic and message
41+
42+
#### [Tutorial six: RPC](https://www.rabbitmq.com/tutorials/tutorial-six-python.html)
43+
44+
cargo run --bin rpc_server
45+
cargo run --bin rpc_client
File renamed without changes.
File renamed without changes.
File renamed without changes.

rust/README.md renamed to rust-lapin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Rust code for RabbitMQ tutorials
1+
# Rust code for RabbitMQ tutorials (using Lapin)
22

33
Here you can find the Rust code examples for [RabbitMQ
44
tutorials](https://www.rabbitmq.com/getstarted.html).
55

66
The examples use [lapin](https://github.com/CleverCloud/lapin) client library.
77

8-
You should have a RabbitMQ server running on default port.
8+
These tutorials assume a RabbitMQ server node running locally using default ports.
99

1010
## Requirements
1111

File renamed without changes.

0 commit comments

Comments
 (0)