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

Route structure

A YAML route file defines one or more routes. Each route has an identifier, a source endpoint, and an ordered list of processing steps.

Minimal route

The smallest useful route reads from a source and writes to a destination.

routes:
  - id: "hello-timer"
    from: "timer:tick?period=2000&repeatCount=3"
    steps:
      - log: "Hello from config-loaded route!"
      - to: "log:info"

The file opens with a routes list. Each list entry is one route object. The route above, hello-timer, reads from a timer endpoint, logs a greeting, and forwards the exchange to the log:info endpoint.

Route fields

Each route object accepts these top-level fields. Only id and from are required. The nested config objects (error_handler, circuit_breaker, security_policy) are documented in the step verbs reference.

FieldTypeRequiredDefaultDescription
idstringyesUnique route identifier
fromstringyesSource endpoint URI
stepslistno[]Ordered step verbs
auto_startupboolnotrueStart the route when the context starts
startup_orderintegerno1000Ascending start order; shutdown reverses it
sequentialboolnofalseProcess exchanges one at a time
concurrentintegernoMaximum concurrent exchanges
error_handlerobjectnoPer-route error handler
circuit_breakerobjectnoRoute-level circuit breaker
security_policyobjectnoRoute-level authorization
on_completestringnoProducer URI for the success hook
on_failurestringnoProducer URI for the failure hook

auto_startup: false registers the route but does not start its consumer. Start it later through the route controller or control bus. concurrent caps how many exchanges the pipeline processes in parallel; omit it to let the runtime decide. on_complete and on_failure fire when an exchange exits the pipeline, on success or on error respectively.

Error handling

Set error_handler to retry failed exchanges and send them to a dead letter channel when retries run out. The handler holds a redelivery policy and optional per-exception clauses. The full field set lives on the step verbs reference.

List-form variant

The hot-reload subsystem consumes a flatter form. When a file holds only routes and omits the top-level routes wrapper, the parser reads the file as a bare list of route objects:

- from: timer:hot-reload?period=1000
  route_id: hot-reload-route
  steps:
    - to: log:info?showHeaders=true

Each entry uses route_id instead of id and carries from and steps. This list form maps to the canonical route contract the runtime exchanges over the control bus, not the full authoring model.

Next

Reference: DSL crate