Prerequisites
Before you begin, make sure you have:- Rust installed (1.70+ recommended)
- A running message broker (Redis, RabbitMQ, or SurrealDB)
Install Broccoli
Add Broccoli to yourCargo.toml:
Define your message type
Create a struct that represents your job payload. It must implementSerialize and Deserialize:
Create a producer
Publish messages to a queue:Create a consumer
Process messages from the queue:Run your application
-
Start your message broker (e.g., Redis):
-
Run the consumer:
-
Run the producer: