rabbitmesh 0.1.0

Message-driven microservices framework using RabbitMQ for zero-port service mesh
Documentation
# πŸš€ RabbitMesh - Message-Driven Microservices Framework

**Zero-port microservices with auto-generated APIs**

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
- **πŸ›‘οΈ Production Ready** - Built-in retries, timeouts, load balancing
- **🌍 Deploy Anywhere** - Docker, Kubernetes, bare metal

## πŸš€ Quick Start

### 1. Define Your Service

```rust
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

```rust
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

```rust
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 framework  
- **`rabbitmesh-macros`** - Code generation macros
- **`rabbitmesh-gateway`** - Auto-generating API gateway
- **`examples/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/ecommerce](examples/ecommerce) directory for a complete microservices demo with user management, authentication, and API gateway.

## πŸ“„ License

MIT license