camel-cli
Command-line interface for Apache Camel in Rust.
Installation
Usage
camel <COMMAND>
Commands:
run Start a Camel context from YAML route files with hot-reload
help Print help
Options:
-h, --help Print help
-V, --version Print version
camel run
Starts a Camel context and loads routes from YAML files. Hot-reload is disabled
by default — enable it with --watch or via Camel.toml.
)
)
Quick start — no config file
# Runs routes/*.yaml without hot-reload
# Same but with hot-reload enabled
With a Camel.toml
Create a Camel.toml next to your route files:
[]
= ["routes/**/*.yaml"]
= "INFO"
= false
[]
= 5
= 1000
= 2.0
= 60000
[]
= "DEBUG"
= true
[]
= "ERROR"
= false
Then run:
# or with an explicit profile (development enables watch = true):
CAMEL_PROFILE=development
# or force watch regardless of profile:
The --routes flag overrides whatever routes is set to in the config file.
--watch / --no-watch override the watch field in Camel.toml.
Hot-reload
Hot-reload is off by default. Enable it with --watch, or set watch = true
in the active profile of Camel.toml:
[]
= true
CAMEL_PROFILE=development
While the watcher is active, edit any watched YAML file and save — the route diff is computed and applied within ~300 ms:
| Change | Effect |
|---|---|
| Edit pipeline steps | Atomic swap_pipeline — zero downtime |
| Add a new route | Route compiled and started |
| Delete a YAML file | Corresponding routes stopped and removed |
Route YAML format
routes:
- id: "my-route"
from: "timer:tick?period=1000"
steps:
- log: "message=Hello from ${routeId}"
- to: "mock:out"
See camel-dsl for the full step reference.
Configuration reference
| Key | Type | Default | Description |
|---|---|---|---|
routes |
[String] |
[] |
Glob patterns for route YAML files |
watch |
bool |
false |
Enable file-watcher hot-reload |
log_level |
String |
"INFO" |
Tracing log level |
timeout_ms |
u64 |
5000 |
Default operation timeout (ms) |
components.timer.period |
u64 |
1000 |
Default timer period (ms) |
components.http.connect_timeout_ms |
u64 |
5000 |
HTTP connect timeout (ms) |
components.http.max_connections |
usize |
100 |
HTTP connection pool size |
observability.metrics_enabled |
bool |
false |
Enable metrics endpoint |
observability.metrics_port |
u16 |
9090 |
Metrics server port |
supervision.max_attempts |
u32? |
5 |
Max route restart attempts (null = unlimited) |
supervision.initial_delay_ms |
u64 |
1000 |
Initial restart delay (ms) |
supervision.backoff_multiplier |
f64 |
2.0 |
Backoff multiplier per retry |
supervision.max_delay_ms |
u64 |
60000 |
Max restart delay cap (ms) |
Environment variable overrides use the CAMEL_ prefix, e.g.
CAMEL_LOG_LEVEL=DEBUG.
Example
See examples/camel-cli-run for a ready-to-run
project layout with a Camel.toml and example routes.
License
Apache-2.0