A general-purpose, scalable service that receives webhook events and publishes them to message brokers (Kafka/RabbitMQ) for other services to consume. (EventFlow, Conduit, Hermes)
For detailed technical information about the system architecture, components, configuration, and deployment, please see the Technical Documentation.
The service follows a modular, layered architecture with the following components:
- Event Receiver API - HTTP server that receives webhook events
- Event Validator - Validates events against JSON schemas
- Event Publisher - Publishes events to the message broker using the outbox pattern
- Dead Letter Queue - Stores and manages failed events
- Configuration Service - Manages dynamic configuration
- Outbox Processor - Reliably publishes events from the outbox to the broker
The service supports multiple message brokers:
- Kafka - For high-throughput event streaming
- RabbitMQ - For flexible routing with exchanges
- Event Schema Validation - Validates events against JSON schemas
- Dynamic Routing - Routes events to different topics/exchanges based on configuration
- Transactional Outbox - Ensures reliable event publishing even during failures
- Dead Letter Queue - Captures and manages failed events
- Metrics & Monitoring - Tracks system health and performance
- Horizontal Scaling - Scales horizontally to handle increasing load
- Go 1.20+
- PostgreSQL 13+
- Kafka or RabbitMQ
- Clone the repository:
git clone https://github.com/chashtager/orchestron.git
cd orchestron- Install dependencies:
go mod download- Create the database:
createdb orchestron
psql -d orchestron -f config/sql/schema.sql- Configure the service:
cp config/config.yaml.example config/config.yaml
# Edit config.yaml with your settings- Build the service:
go build -o build/orchestron ./cmd/orchestron
go build -o build/subscriber ./cmd/subscriber # example rabbitmq subscriber for test./build/orchestronA Dockerfile and docker-compose.yml are provided for containerized deployment:
docker-compose up -dThe service can be configured using a YAML file, environment variables, or a combination of both:
# Example configuration
api:
address: ":8080"
rate_limit: 100
rate_limit_burst: 20
max_payload_size: "1MB"
database:
host: "localhost"
port: 5432
user: "postgres"
password: "postgres"
name: "orchestron"
max_connections: 20
broker:
type: "rabbitmq" # or "kafka"
rabbitmq:
host: "localhost"
port: 5672
user: "guest"
password: "guest"
vhost: "/"
prefetch_count: 100
routing:
default_topic: "events"
default_exchange: "events"
default_routing_key: "#"
max_retries: 3
outbox:
process_interval: "5s"
batch_size: 100The service exposes metrics and health checks:
- Health Check:
GET /health - Metrics:
GET /metrics(Prometheus format)
├── cmd/ # Application entry points
│ └── orchestron/ # Main application
├── internal/ # Private application code
│ ├── api/ # HTTP API implementation
│ ├── broker/ # Message broker integrations
│ ├── config/ # Configuration
│ ├── models/ # Data models
│ ├── processor/ # Event processing
│ ├── repository/ # Database repositories
│ ├── service/ # Core services
│ └── metrics/ # Metrics collection
├── docs/ # Documentation
├── config/ # Configuration files
└── docker-compose.yml # Docker deployment
Run the tests:
go test ./...Run with coverage:
go test -cover ./...- Horizontal Scaling: Deploy multiple instances behind a load balancer
- Batch Processing: Process outbox entries in batches for efficiency
- Connection Pooling: Use connection pools for database and broker connections
- Monitoring: Monitor queue depths and consumer lag
- Rate Limiting: Implement rate limiting for webhook endpoints
-
Security:
- Use TLS for all communications
- Implement API key rotation
- Encrypt sensitive data
-
Monitoring:
- Track event processing rates and latencies
- Monitor queue depths
- Set up alerts for DLQ growth
-
Disaster Recovery:
- Implement regular backups
- Create recovery runbooks
- Conduct disaster recovery drills
-
Documentation:
- Maintain API documentation
- Document event schemas
- Create operational procedures
This project is licensed under the MIT License - see the LICENSE file for details.
