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

Installation

Install rust-camel to build integration routes in Rust. Two paths: embed the crates in a Rust application, or run YAML routes with the CLI.

Prerequisites

Install the Rust toolchain with rustup. rust-camel requires Rust 1.89 or newer. The workspace pins edition 2024, and the Tokio async runtime needs a current stable release.

Confirm your toolchain:

rustc --version

Path 1: Embed in a Rust project

Add the core crates to an existing Cargo project:

cargo add camel-core camel-builder camel-api

Then add only the components your routes reference. A timer-to-log route needs two endpoint crates:

cargo add camel-component-timer camel-component-log

These commands resolve the latest published release from crates.io. The resulting [dependencies] block looks like:

[dependencies]
camel-api = "0.26"
camel-core = "0.26"
camel-builder = "0.26"
camel-component-timer = "0.26"
camel-component-log = "0.26"
tokio = { version = "1", features = ["full"] }
tracing-subscriber = "0.3"

camel-core provides CamelContext, the runtime that starts and stops routes. camel-builder provides the fluent RouteBuilder API. camel-api provides the Exchange, Message, and Value types. Each component crate is optional. Add only what a route references.

Write your first route next: First route in Rust.

Path 2: Run YAML routes with the CLI

The camel CLI parses YAML route files and starts them without compiling Rust. Install the binary from crates.io:

cargo install camel-cli

This places camel on your PATH. Confirm the install:

camel --version

Scaffold a project and run it:

camel new my-integration
cd my-integration
camel run

camel new creates a Camel.toml config file and a routes/ directory with a starter route. camel run starts the Camel context from that config.

Write your first YAML route next: First route in YAML.

Run the examples from source

The repository ships compiled examples. Clone it and run one to verify your toolchain:

git clone https://github.com/kennycallado/rust-camel.git
cd rust-camel
cargo run -p hello-world

The hello-world example fires a timer five times and logs each tick. You should see five log lines, then the process waits for Ctrl+C.

Troubleshooting

SymptomFix
rustc 1.xx is unsupportedRun rustup update stable. rust-camel needs 1.89 or newer.
camel: command not foundcargo install puts binaries in ~/.cargo/bin. Add it to your PATH.
error[E0658] on edition 2024 featuresYour rustc is too old. See the first row.

Next steps

Reference: CLI crate