2 unstable releases
Uses new Rust 2024
| 0.2.0 | Aug 30, 2025 |
|---|---|
| 0.1.0 | Aug 28, 2025 |
#1686 in Procedural macros
69 downloads per month
Used in 2 crates
72KB
1K
SLoC

RabbitMesh
Zero-Port Microservices Framework
Write business logic, get REST + GraphQL APIs automatically
RabbitMesh eliminates traditional microservice complexity by using RabbitMQ for all inter-service communication. Write business logic, get REST + GraphQL APIs automatically.
✨ Key Features
- 🔥 Zero Port Management - Services only connect to RabbitMQ
- ⚡ Never Blocks - Every request spawns async task
- 🎯 Auto-Generated APIs - Write service methods, get REST + GraphQL
- 🎭 Universal Macros - 50+ macros for auth, caching, validation, metrics
- 🛡️ Production Ready - Built-in retries, timeouts, load balancing
- 🌍 Deploy Anywhere - Docker, Kubernetes, bare metal
📚 Documentation
- 🚀 Quick Start Guide - Get started in 5 minutes
- 📖 Complete Developer Guide - Comprehensive guide with real-world examples
- 🏗️ API Documentation - Full API reference
- 📋 Publishing Guide - How to publish to crates.io
🚀 Quick Start
1. Define Your Service
use rabbitmesh_macros::{service_definition, service_method};
#[service_definition]
pub struct UserService;
impl UserService {
#[service_method("GET /users/:id")]
pub async fn get_user(user_id: u32) -> Result<User, String> {
// Your business logic only
Ok(User { id: user_id, name: "John".to_string() })
}
#[service_method("POST /users")]
pub async fn create_user(data: CreateUserRequest) -> Result<User, String> {
// Handle user creation
Ok(User { id: 1, name: data.name })
}
}
2. Start Your Service
use rabbitmesh::MicroService;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let service = MicroService::new("amqp://localhost:5672").await?;
service.start().await?; // Never blocks, handles requests concurrently
Ok(())
}
3. Auto-Generated API Gateway
use rabbitmesh_gateway::create_auto_router;
#[tokio::main]
async fn main() {
let app = create_auto_router().await;
// Automatically provides:
// GET /api/v1/user-service/users/123
// POST /api/v1/user-service/users
// GraphQL endpoint at /graphql
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
.serve(app.into_make_service())
.await
.unwrap();
}
🏗️ Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────────────────────────┐
│ Frontend │────│ API Gateway │────│ Service Mesh │
│ (NextJS) │HTTP│ (Auto-Gen) │AMQP│ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │ │ │ │ │User │ │Auth │ │Order│ ... │
└─────────────┘ └─────────────┘ │ └─────┘ └─────┘ └─────┘ │
│ │ │
│ ┌─────────────┐ │
│ │ RabbitMQ │ │
│ │ Broker │ │
└─────┴─────────────┴────────────┘
📦 Crates
rabbitmesh- Core microservice frameworkrabbitmesh-macros- Code generation macrosrabbitmesh-gateway- Auto-generating API gatewayexamples/ecommerce- Complete demo application
🎯 Why RabbitMesh?
| Traditional HTTP | RabbitMesh |
|---|---|
| ❌ Port management hell | ✅ Zero ports to manage |
| ❌ Manual load balancing | ✅ Automatic via RabbitMQ |
| ❌ Service discovery complexity | ✅ Auto-discovery via queues |
| ❌ Blocking request handlers | ✅ Every request is async |
| ❌ Manual API development | ✅ Auto-generated REST + GraphQL |
🚀 Performance
- Latency: 3-10ms (vs 1-5ms HTTP direct)
- Throughput: Higher than HTTP (persistent connections)
- Concurrency: Unlimited (every request = async task)
- Scalability: Linear (add instances = proportional capacity)
📋 Getting Started
See the examples/simple-todo directory for a complete working example, or use our AI agent to create new projects:
# Install the AI agent and create a new project
python3 rabbitmesh_agent.py create my-awesome-service
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📄 License
MIT license. See LICENSE for details.

Built with ❤️ by the RabbitMesh Team
🦀 Crates.io • 📚 Docs • 🐙 GitHub • 💬 Discussions
The future of microservices is here - zero ports, maximum power, pure elegance ✨
Dependencies
~4–26MB
~401K SLoC