https://github.com/mrrobb/rust-consumer-producer
https://github.com/mrrobb/rust-consumer-producer
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mrrobb/rust-consumer-producer
- Owner: MrRobb
- Created: 2020-09-22T08:29:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-23T21:56:05.000Z (almost 6 years ago)
- Last Synced: 2025-01-21T06:43:28.878Z (over 1 year ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multiple Consumers <-> Multiple Producers Showcase
Example of a consumer <-> producer system in Rust.

### Requirements
- Rust
- Docker Compose
### Install
```sh
# Install sqlx (cli tool)
cargo install --version=0.1.0-beta.1 sqlx-cli
```
### Usage
```sh
# Initialize RabbitMQ, Postgres and PgAdmin4
docker-compose up
# Setup database
export DATABASE_URL="postgres://guest:guest@localhost/guestdb"
sqlx db create
sqlx migrate run
# Execute consumer
cargo run --release --bin consumer
# Execute producer
cargo run --release --bin producer -- --n-messages 1000
```
> You can go to localhost:15672 to access the RabbitMQ administrator dashboard.
> You can go to localhost:8080 to access the PgAdmin4 administrator panel.