Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chinmayvivek/rust-redis-pub-sub
This project demonstrates a simple Pub/Sub (Publish/Subscribe) integration with Redis using Rust. It includes examples of a Redis publisher and subscriber, showcasing how to send and receive messages. Redis is run using Docker for ease of setup and management.
https://github.com/chinmayvivek/rust-redis-pub-sub
pubsub redis rust rust-lang
Last synced: 3 days ago
JSON representation
This project demonstrates a simple Pub/Sub (Publish/Subscribe) integration with Redis using Rust. It includes examples of a Redis publisher and subscriber, showcasing how to send and receive messages. Redis is run using Docker for ease of setup and management.
- Host: GitHub
- URL: https://github.com/chinmayvivek/rust-redis-pub-sub
- Owner: CHINMAYVIVEK
- Created: 2024-07-20T12:55:33.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-20T12:56:58.000Z (5 months ago)
- Last Synced: 2024-12-16T16:07:04.671Z (12 days ago)
- Topics: pubsub, redis, rust, rust-lang
- Language: Rust
- Homepage: https://chinmayvivek.github.io
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-redis-pub-sub
This project demonstrates a simple Pub/Sub (Publish/Subscribe) integration with Redis using Rust. It includes examples of a Redis publisher and subscriber, showcasing how to send and receive messages. Redis is run using Docker for ease of setup and management.
## Features
- **Redis Publisher**: Sends messages to a Redis channel.
- **Redis Subscriber**: Listens for messages from a Redis channel and processes them.
- **Dockerized Redis**: Uses Docker to simplify the setup and management of Redis.## Prerequisites
- Rust (latest stable version recommended)
- Docker and Docker Compose
- Cargo (Rust's package manager)## Getting Started
### Step 1: Clone the Repository
```bash
git clone https://github.com/chinmayvivek/rust-redis-pub-sub.git
cd rust-redis-pub-sub
```### Step 2: Build the Rust Project
```bash
cargo build
```### Step 3: Setup Redis using Docker
1. **Ensure Docker is installed and running on your system**.
2. **Start Redis**:```bash
docker run -d -p 6379:6379 redis
```### Step 4: Run the Subscriber
Open a terminal and run:
```bash
cargo run --quiet
```## Usage
1. **Publish messages**: The publisher sends messages to a Redis channel.
2. **Subscribe to messages**: The subscriber listens for messages on the same Redis channel and processes them as they arrive.## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [Redis](https://redis.io/)
- [redis-rs crate](https://docs.rs/redis/)
- [Docker](https://www.docker.com/)