Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Camel.toml schema

Camel.toml is the operator surface for rust-camel. The file is TOML, parsed by CamelConfig::from_file, and deserialized into the CamelConfig struct. Most fields live under [default] and merge with named profiles ([production], [staging], ...) per the profile rules described in Configuration.

A minimal file sets the route discovery glob and the log level. Everything else has a runtime default.

[default]
routes = ["routes/**/*.yaml"]
log_level = "INFO"

A fuller file adds supervision, tracing, and shared component defaults. Profiles override per environment.

[default]
routes = ["routes/**/*.yaml"]
log_level = "INFO"

# Optional supervision configuration
[default.supervision]
max_attempts = 5
initial_delay_ms = 1000
backoff_multiplier = 2.0
max_delay_ms = 60000

# Optional tracing configuration
[default.observability.tracer]
enabled = true
detail_level = "minimal"

[default.observability.tracer.outputs.stdout]
enabled = true
format = "json"

# Component defaults (optional) - apply to all endpoints unless overridden by URI
# Uncomment to enable global component settings:

# [default.components.http]
# connect_timeout_ms = 5000
# response_timeout_ms = 30000
# max_connections = 100
# allow_internal = false

# [default.components.kafka]
# brokers = "localhost:9092"
# group_id = "camel"
# session_timeout_ms = 45000

# [default.components.redis]
# host = "localhost"
# port = 6379

# [default.components.sql]
# max_connections = 5
# min_connections = 1
# idle_timeout_secs = 300

# [default.components.file]
# delay_ms = 500
# read_timeout_ms = 30000

# [default.components.container]
# docker_host = "unix:///var/run/docker.sock"

# Optional persistent idempotent repository (opt-in). When set under the
# active profile, registers a "redb" backend for `idempotent_consumer` steps;
# keys persist across restart. The default "memory" repo stays available.
# durability: "immediate" (default, fsync per key) | "eventual" (no fsync, faster)
# [default.idempotent_repo]
# path = ".camel/idempotent.redb"
# durability = "immediate"

[development]
log_level = "DEBUG"

[production]
log_level = "ERROR"

Top-level fields

The fields below live directly under [default]. They are the spine of the file. Every other section in this page is optional.

FieldTypeDefaultDescription
routesarray of strings[]Glob patterns for route files (YAML or JSON). Discovery runs at startup and on every file change when watch is enabled.
watchboolfalseEnable the file watcher. When true, route file changes trigger a hot reload. See Hot reload.
watch_debounce_msinteger (ms)300Delay after the last file event before a reload. Increase if one save triggers several reloads.
log_levelstring"INFO"One of TRACE, DEBUG, INFO, WARN, ERROR.
timeout_msinteger (ms)5000Per-exchange timeout enforced by the runtime. Must be > 0.
drain_timeout_msinteger (ms)10000Maximum time the runtime waits for in-flight exchanges to finish on shutdown. Must be > 0.
includearray of stringsPaths to other TOML files merged before the profile pass. See Configuration.

The watcher and the file are wired through camel-core::reload_watcher::watch_and_reload (see ADR-0004). The --watch and --no-watch CLI flags override this field at startup.

[components]

Component configuration is untyped TOML keyed by component name. Each component bundle parses its own block. The schema below is the union of fields the runtime and core components recognize.

[components.http]
connect_timeout_ms = 5000
response_timeout_ms = 30000
allow_internal = false

[components.kafka]
brokers = "localhost:9092"
group_id = "camel"

The full per-component schema lives in each component's documentation. The Kafka block is the most complex and supports a [components.kafka.brokers_named.<name>] sub-table for pre-configured clusters referenced from URIs with ?brokerName=<name>. See Kafka for the named-broker fields.

Common fieldTypeDefaultDescription
brokersstring or list of stringscomponent-specificConnection string for the underlying client. Kafka accepts a comma-separated string.
host, portstring, integercomponent-specificListen address for components that open servers.
connect_timeout_msintegercomponent-specificTimeout for establishing a connection.
allow_internalboolfalseAllow private/loopback endpoints. Set true only for local development.

Custom component bundles follow the same convention. A bundle named echo reads its config from [components.echo]. See Custom component for the bundle contract.

[supervision]

The runtime uses these knobs to restart a failed Consumer with capped exponential backoff. Defaults match a one-second start, doubling each attempt, capped at one minute, with five attempts.

FieldTypeDefaultDescription
max_attemptsinteger or null5Maximum restart attempts. null retries forever.
initial_delay_msinteger (ms)1000Delay before the first attempt. Must be > 0.
backoff_multiplierfloat2.0Multiplier applied to the delay after each failure. Must be >= 1.0.
max_delay_msinteger (ms)60000Cap on the per-attempt delay. Must be > 0.

[observability]

The observability block holds four optional sub-tables. The [observability.tracer] block configures the built-in tracing layer. The other three activate optional exporters.

FieldTypeDefaultDescription
tracertable(built-in defaults)Built-in tracing layer config.
oteltableabsentOpenTelemetry exporter. Absent disables OTLP.
prometheustableabsentPrometheus scrape endpoint. Absent disables the endpoint.
healthtableabsentHTTP health/readiness endpoint. Absent disables the endpoint.

[observability.otel]

OTLP export configuration. The protocol and sampler accept the values listed below; values not in the enum fail at load.

FieldTypeDefaultDescription
enabledboolfalseMaster switch for OTLP export.
endpointstring"http://localhost:4317"OTLP collector endpoint.
service_namestring"rust-camel"Resource attribute identifying the service.
protocolstring"grpc"OTLP transport: grpc or http.
samplerstring"always_on"Sampling strategy: always_on, always_off, ratio.
sampler_ratiofloatnullSampling probability for the ratio strategy. Range 0.0-1.0.
metrics_interval_msinteger (ms)60000Period for the metrics export loop. Must be > 0.
logs_enabledbooltrueInclude log records in the OTLP stream.
resource_attrstable{}Extra resource attributes attached to every export.

[observability.prometheus]

FieldTypeDefaultDescription
enabledboolfalseStart the scrape endpoint.
hoststring"0.0.0.0"Bind address.
portinteger9090Bind port.

[observability.health]

FieldTypeDefaultDescription
enabledboolfalseStart the HTTP health endpoint.
hoststring"0.0.0.0"Bind address.
portinteger8081Bind port.
handler_timeout_msinteger (ms)6000Per-probe timeout. Must exceed the internal 5s registry tick.
forced_ttl_msinteger (ms) or nullnullOptional TTL for forced-unhealthy entries. Disabled by default.

[security]

The security block holds five optional sub-tables. Pick one. Most deployments choose exactly one of oidc, native, or keycloak. The permissions and policies sub-tables extend the chosen identity layer with authorization.

[security.keycloak]
server_url = "https://kc.example.com"
realm = "my-realm"
client_id = "camel"
client_secret = "{{env:KC_SECRET}}"
FieldTypeDefaultDescription
oidctableabsentGeneric OIDC token validation.
nativetableabsentBuilt-in issuer with m2m clients.
keycloaktableabsentKeycloak realm with validation, JWKS, introspection, and UMA.
permissionstable of tablesabsentNamed permission evaluators keyed by policy name.
policiestableabsentRegistry of WASM security policies referenced by route configuration.

[security.oidc]

FieldTypeDefaultDescription
issuerstring(required)OIDC issuer URL used to discover endpoints.
jwks_uristringnullJWKS endpoint. Defaults to ${issuer}/protocol/openid-connect/certs.
audiencearray of strings[]Required aud claim values.
client_idstringnullOAuth2 client ID.
client_secretstringnullOAuth2 client secret. Prefer a placeholder over a literal.
token_endpointstringnullToken endpoint for client credentials flows.
introspection_endpointstringnullToken introspection endpoint.

[security.native]

The native block provides a built-in token issuer plus a list of m2m clients. Set subject to the m2m principal.

FieldTypeDefaultDescription
subjectstring(required)Principal name for the m2m identity.
issuerstringnullIssuer claim on issued tokens.
bearer_tokenstringnullPre-issued bearer token. Prefer a placeholder.
api_keystringnullPre-shared API key. Prefer a placeholder.
rolesarray of strings[]Roles granted to the identity.
scopesarray of strings[]Scopes granted to the identity.
token_issuertableabsentBuilt-in token issuer config.
clientsarray of tables[]m2m clients allowed to authenticate.

[security.native.token_issuer] fields:

FieldTypeDefaultDescription
issuerstring(required)Issuer URL.
audiencearray of strings[]Required aud claim.
token_ttl_secsinteger (s)900Issued-token lifetime.
signing_key_envstring(required)Environment variable holding the signing key (PEM).

[[security.native.clients]] array elements:

FieldTypeDefaultDescription
client_idstring(required)Client identifier.
client_secret_envstring(required)Environment variable holding the client secret.
rolesarray of strings[]Roles assigned to tokens minted for this client.
scopesarray of strings[]Scopes assigned to tokens minted for this client.

[security.keycloak]

FieldTypeDefaultDescription
server_urlstring(required)Keycloak base URL.
realmstring(required)Realm name.
client_idstring(required)Client ID.
client_secretstring(required)Client secret. Prefer a placeholder.
validationtable(defaults below)Token validation options.
jwkstable(defaults below)JWKS cache tuning.
introspectiontable(defaults below)Introspection cache tuning.
umatableabsentUMA authorization provider.
allow_internalboolfalseAllow HTTP and private addresses. Set true only for local Keycloak.

[security.keycloak.validation] fields:

FieldTypeDefaultDescription
methodstring"local"Validation method. "local" validates signature and claims locally.
audiencearray of strings[]Required aud claim values.
clock_skew_secsinteger (s)30Tolerance for exp and nbf claims.

[security.keycloak.jwks] fields:

FieldTypeDefaultDescription
cache_ttl_secsinteger (s)3600How long the JWKS cache holds keys.
refresh_skew_secsinteger (s)60Refresh the cache this many seconds before expiry.

[security.keycloak.introspection] fields:

FieldTypeDefaultDescription
max_entriesinteger10000Maximum cached introspection results.
default_ttl_secsinteger (s)60TTL for positive results.
negative_ttl_secsinteger (s)5TTL for negative results.

[security.permissions.<name>]

Named permission evaluators. A route references the name through route configuration.

[security.permissions.invoice-policy]
provider = "wasm"
path = "./policies/invoice-policy.wasm"

[security.permissions.invoice-policy.config]
mode = "enforce"

[security.permissions.invoice-policy.cache]
positive_ttl_secs = 60
negative_ttl_secs = 10
FieldTypeDefaultDescription
providerstring(required)Provider key. Currently wasm.
pathstringnullProvider-specific path. WASM providers need a .wasm file.
configtableabsentKey-value pairs passed to the provider.
cachetable(defaults below)Result cache tuning.
limitstableabsentWASM limits. See WASM limits.

[security.permissions.<name>] cache fields:

FieldTypeDefaultDescription
positive_ttl_secsinteger (s)30TTL for allow decisions.
negative_ttl_secsinteger (s)5TTL for deny decisions.
max_entriesinteger10000Cache size.

[security.policies.wasm.<name>]

Registry of named WASM security policies. Each entry is a path plus limits plus a config map.

[security.policies.wasm.corp-auth]
path = "plugins/authz.wasm"

[security.policies.wasm.corp-auth.limits]
timeout-secs = 30

[security.policies.wasm.corp-auth.config]
ldap_url = "ldap://corp"
FieldTypeDefaultDescription
pathstring(required)Path to the .wasm file. Relative to the project root or absolute.
limitstableabsentWASM limits. See WASM limits.
configtable{}Key-value pairs passed to the guest init().

[runtime_journal]

The runtime event journal. When unset, runtime state is ephemeral and lost on restart. Set a path to enable a redb-backed journal.

FieldTypeDefaultDescription
pathstring(required)Path to the .db file. Created if it does not exist. Must not be empty.
durabilitystring"immediate"immediate fsyncs on every commit. eventual skips fsync for throughput.
compaction_threshold_eventsinteger10000Trigger compaction after this many events. Must be > 0.

[idempotent_repo]

Persistent idempotent repository for the Idempotent Consumer EIP. When unset, the runtime uses the in-memory MemoryIdempotentRepository, which is bounded and ephemeral.

FieldTypeDefaultDescription
pathstring(required)Path to the .redb file. Must not be empty.
durabilitystring"immediate"immediate fsyncs on every key. eventual skips fsync.

[stream_caching]

The Stream Cache step buffers stream bodies past a threshold so the body can be read more than once. The cache applies to the whole runtime, not per route.

FieldTypeDefaultDescription
thresholdinteger (bytes)camel_api::stream_cache::DEFAULT_STREAM_CACHE_THRESHOLDBodies below this size pass through unread. Bodies above this size are buffered.

[platform]

Platform selection for leader election, readiness, and identity. Defaults to noop, which always reports leader and ready. Set type = "kubernetes" to enable leader election through a Kubernetes lease.

FieldTypeDefaultDescription
typestring"noop"noop or kubernetes.

[platform] with type = "kubernetes" accepts:

FieldTypeDefaultDescription
namespacestringnullNamespace for the lease object. Defaults to the pod's namespace.
lease_name_prefixstring"camel-"Prefix on the lease object name.
lease_duration_secsinteger (s)15Lease lifetime. Must be > 0.
renew_deadline_secsinteger (s)10Maximum time the leader can hold the lease between renewals. Must be > 0.
retry_period_secsinteger (s)2How often a non-leader retries acquisition. Must be > 0.
jitter_factorfloat0.2Randomisation applied to the retry period. Range 0.0-1.0.

[languages]

The languages block tunes the resource limits for the in-process scripting engines. Each sub-block is optional. Unset fields fall back to the rust-camel runtime default, never to the upstream engine's unlimited default.

[languages.rhai.limits]

Rhai sandbox limits.

FieldTypeDefaultDescription
max-operationsintegerruntime defaultMaximum operations per script. Counter resets each call.
max-string-sizeinteger (bytes)runtime defaultMaximum string size in bytes.
max-array-sizeintegerruntime defaultMaximum array size in elements.
max-map-sizeintegerruntime defaultMaximum map size in key-value pairs.
max-expression-depthintegerruntime defaultMaximum expression nesting depth.
max-function-expression-depthintegerruntime defaultMaximum nesting depth for function call expressions.
execution-timeout-msinteger (ms)runtime defaultWall-clock timeout enforced by the consuming code.

[languages.js.limits]

Boa JavaScript engine limits.

FieldTypeDefaultDescription
execution-timeout-msinteger (ms)runtime defaultWall-clock timeout enforced by the consuming code.
max-loop-iterationsintegerruntime defaultMaximum loop iterations before Boa terminates.
max-recursion-depthintegerruntime defaultMaximum recursion depth for function calls.
max-stack-sizeinteger (slots)runtime defaultMaximum VM stack size in slots, not bytes.

[languages.minijinja.limits]

MiniJinja template engine limits.

FieldTypeDefaultDescription
max-template-source-sizeinteger (bytes)runtime defaultMaximum compiled template source size.
max-context-sizeinteger (bytes)runtime defaultMaximum serialised context size.
max-output-sizeinteger (bytes)runtime defaultMaximum rendered output size.
fuelintegerruntime defaultMiniJinja VM instruction budget.
max-recursion-depthintegerruntime defaultMaximum recursion depth for includes and blocks.
execution-timeout-msinteger (ms)runtime defaultWall-clock timeout enforced by the consuming code.

[components.template.limits]

The external Template component's resource limits. Set any subset of fields. Unset fields fall back to the resolved defaults listed below.

[components.template.limits]
max-total-source-bytes = 16777216
max-include-count = 64
max-include-depth = 16
max-template-size = 1048576
reload-timeout-ms = 5000
FieldTypeResolved defaultDescription
max-total-source-bytesinteger (bytes)16777216 (16 MiB)Maximum total source bytes across a template dependency closure.
max-include-countinteger64Maximum number of included or imported templates per closure.
max-include-depthinteger16Maximum include and extends nesting depth.
max-template-sizeinteger (bytes)1048576 (1 MiB)Maximum size of a single template file.
reload-timeout-msinteger (ms)5000Wall-clock budget for a full reload build.

Zero values are rejected. The block uses deny_unknown_fields, so a typo is caught at load.

[beans]

Named beans are WASM plugins exposed to routes as lookup targets. Each bean is keyed by name and carries a plugin path plus an optional config map and WASM limits.

[beans.auth]
plugin = "my-auth"

[beans.auth.config]
api_key = "{{env:API_KEY}}"

[beans.auth.limits]
timeout-secs = 600
FieldTypeDefaultDescription
pluginstring(required)Plugin identifier or .wasm path. Must be non-empty.
configtable{}Key-value pairs passed to the plugin.
limitstableabsentWASM limits. See WASM limits.

WASM limits

WASM limits appear in three places: [beans.<name>.limits], [security.permissions.<name>.limits], and [security.policies.wasm.<name>.limits]. The struct is the same in all three. The fields use kebab-case. Unset fields fall back to the rust-camel runtime default. The defaults are finite: 50 MiB max memory, 10 MB max wasm size, 10 000 max instances, 10 000 max tables.

FieldTypeRuntime defaultDescription
timeout-secsinteger (s)runtime defaultMaximum execution time per guest call.
max-memoryinteger (bytes)52428800 (50 MiB)Maximum linear memory the guest can allocate. Enforced by wasmtime.
max-concurrent-callsintegerruntime defaultMaximum concurrent invocations against this plugin.
max-wasm-sizeinteger (bytes)10485760 (10 MB)Maximum .wasm file size.
allow-call-schemesstringnull (deny all)Comma-separated URI schemes the guest may call. Empty or null fails closed.
max-stream-bytesinteger (bytes)runtime defaultMaximum body bytes streamed between host and guest.
max-instancesinteger10000Maximum core instances per store.
max-tablesinteger10000Maximum tables per store.
max-table-elementsintegerunlimitedMaximum elements per table.

[datasources]

Named datasource pools. Each entry is keyed by a name routes reference with the sql-ds://<name> URI scheme. The block is a map of DatasourceConfig values.

[default.datasources.appdb]
db_url = "sqlite:file:memdb?mode=memory&cache=shared"
max_connections = 5
FieldTypeDefaultDescription
db_urlstring(required)Connection URL. postgresql://, postgres://, and ws:// (SurrealDB) are recognised. Must not be empty.
providerstringnullProvider override. Defaults from the URL scheme.
max_connectionsintegernullMaximum pool size.
min_connectionsintegernullMinimum pool size.
idle_timeout_secsinteger (s)nullIdle connection timeout.
max_lifetime_secsinteger (s)nullMaximum connection lifetime.
ssl_modestringnullTLS mode. Provider-specific values.
ssl_root_certstringnullPath to the root CA.
ssl_certstringnullPath to the client certificate.
ssl_keystringnullPath to the client key.
extratable{}Provider-specific key-value pairs. SurrealDB reads namespace and database from here.

Profile overrides

[default] always applies. A named profile like [production] is selected through CAMEL_PROFILE=production or the loader API. Profile blocks deep-merge on top of [default]. The example below shows a [production] block tightening timeouts and pointing Kafka at the production cluster.

# Shared component defaults live in a separate file so they can be reused
# across deployment configs without duplication.
include = ["config/components.toml"]

[default]
routes = ["routes/**/*.yaml"]
log_level = "INFO"

# Optional supervision configuration
[default.supervision]
max_attempts = 5
initial_delay_ms = 1000
backoff_multiplier = 2.0
max_delay_ms = 60000

# Optional tracing configuration
[default.observability.tracer]
enabled = true
detail_level = "minimal"

[default.observability.tracer.outputs.stdout]
enabled = true
format = "json"

# Development profile - more verbose, local services
[development]
log_level = "DEBUG"

[development.components.http]
allow_internal = true  # Allow internal services in dev

[development.components.kafka]
brokers = "localhost:9092"

# Production profile - stricter settings, remote services
[production]
log_level = "WARN"

[production.components.http]
connect_timeout_ms = 5000   # Faster fail in production
allow_internal = false

[production.components.kafka]
brokers = "prod-kafka:9092"
group_id = "camel-prod"
session_timeout_ms = 60000

The [development] and [production] blocks set a log_level and override shared component defaults. Shared component defaults can also live in a separate file pulled through include. See Configuration for the merge rules and the include order.

Environment variable overrides

A small allowlist of CAMEL_* environment variables overrides specific fields when the runtime calls CamelConfig::from_file_with_env. The allowlist is the security boundary: any CAMEL_* variable not in the list is ignored at load and logged as a warning.

VariableField
CAMEL_TIMEOUT_MStimeout_ms
CAMEL_DRAIN_TIMEOUT_MSdrain_timeout_ms
CAMEL_WATCHwatch
CAMEL_WATCH_DEBOUNCE_MSwatch_debounce_ms
CAMEL_LOG_LEVELlog_level
CAMEL_RUNTIME_JOURNAL_PATHruntime_journal.path
CAMEL_RUNTIME_JOURNAL_DURABILITYruntime_journal.durability
CAMEL_RUNTIME_JOURNAL_COMPACTION_THRESHOLD_EVENTSruntime_journal.compaction_threshold_events
CAMEL_IDEMPOTENT_REPO_PATHidempotent_repo.path
CAMEL_IDEMPOTENT_REPO_DURABILITYidempotent_repo.durability
CAMEL_SUPERVISION_INITIAL_DELAY_MSsupervision.initial_delay_ms
CAMEL_SUPERVISION_MAX_ATTEMPTSsupervision.max_attempts

CAMEL_CONFIG_FILE and CAMEL_PROFILE are also read, but outside the allowlist. CAMEL_CONFIG_FILE selects the file path before load. CAMEL_PROFILE selects the profile section.

Reference: Config crate