Architecture
Overview
GoCamel follows a modular architecture inspired by Apache Camel but adapted to Go idioms.
graph LR
subgraph "Core Layer"
A[CamelContext] --> B[Registry]
A --> C[RouteController]
A --> D[TypeConverter]
end
subgraph "Integration Layer"
E[Components] --> F[Endpoints]
F --> G[Consumers]
F --> H[Producers]
end
subgraph "DSL Layer"
I[RouteBuilder] --> J[Processors]
J --> K[EIP Patterns]
end
C --> E
K --> G
K --> HLayers
1. Core Layer
GoCamel core, independent of transports:
- CamelContext — Container for routes and components
- Registry — Named component registry
- Exchange — In-flight message container
- Message — Message body + headers
2. Integration Layer
Communication components:
Example flow:
3. DSL Layer
Fluent API for building routes:
Design Patterns
Factory Pattern
Builder Pattern
Strategy Pattern
EIPs use the Strategy Pattern:
Concurrency
GoCamel leverages Go goroutines:
graph TB
subgraph "Route Thread"
C[Consumer] --> P1[Processor 1]
P1 --> P2[Processor 2]
P2 --> P3[Producer]
end
subgraph "Multicast"
M[Multicast] --x B1[Branch 1]
M --x B2[Branch 2]
M --x B3[Branch 3]
endMulticast branches execute in parallel when configured: