Skip to main content

Crate camel_core

Crate camel_core 

Source
Expand description

§Camel Core

This crate provides the core functionality for the Apache Camel implementation in Rust.

§Tracer EIP

The Tracer Enterprise Integration Pattern (EIP) provides automatic message flow tracing throughout your Camel routes. It captures detailed information about each step as messages flow through the integration routes, helping with debugging, monitoring, and observability.

§Configuration

You can configure the tracer in your Camel.toml file:

[observability.tracer]
enabled = true
detail_level = "minimal"  # minimal | medium | full

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

Or enable it programmatically:

use camel_core::CamelContext;
let mut ctx = CamelContext::new();
ctx.set_tracing(true);

§Span Fields

Each trace span includes the following fields:

  • correlation_id: Unique identifier that links all spans in a single message flow
  • route_id: Identifier for the route being traced
  • step_id: Unique identifier for this specific step in the route
  • step_index: Sequential index of this step within the route
  • timestamp: When the step was executed (Unix timestamp)
  • duration_ms: How long the step took to execute in milliseconds
  • status: The status of the step execution (e.g., “success”, “error”)

§Detail Levels

The tracer supports three levels of detail:

  • Minimal: Includes only the base fields listed above
  • Medium: Includes the base fields plus:
    • headers_count: Number of message headers
    • body_type: Type of the message body
    • has_error: Whether the message contains an error
    • output_body_type: Type of the output body after processing
  • Full: Includes all fields from Minimal and Medium plus:
    • Up to 3 message headers (header_0, header_1, header_2)

//! Configuration types for the Tracer EIP live in camel-core rather than camel-config //! to avoid a circular dependency — camel-config depends on camel-core.

Re-exports§

pub use crate::lifecycle::domain::RouteLifecycleCommand;
pub use crate::lifecycle::domain::RouteRuntimeAggregate;
pub use crate::lifecycle::domain::RouteRuntimeState;
pub use crate::lifecycle::domain::RuntimeEvent;
pub use context::CamelContext;

Modules§

context
lifecycle
reload_watcher
route
route_controller
supervising_route_controller

Structs§

DefaultRouteController
Default implementation of RouteController.
FileOutput
FileRuntimeEventJournal
InMemoryCommandDedup
InMemoryEventPublisher
InMemoryProjectionStore
InMemoryRouteRepository
InMemoryRuntimeStore
Registry
Registry that stores components by their URI scheme.
ReloadWatcher
Route
A Route defines a message flow: from a source endpoint, through a composed Tower Service pipeline.
RouteDefinition
An unresolved route definition. “to” URIs have not been resolved to producers yet.
RouteStatusProjection
RuntimeBus
RuntimeExecutionAdapter
Runtime side-effect adapter backed by the technical route controller.
StdoutOutput
SupervisingRouteController
A route controller that automatically restarts crashed routes.
TracerConfig
Configuration for the Tracer EIP (Enterprise Integration Pattern).
TracerOutputs
TracingProcessor
A processor wrapper that emits tracing spans for each step.

Enums§

BuilderStep
A step in an unresolved route definition.
CamelError
Core error type for the Camel framework.
DetailLevel
Controls the level of detail captured in trace spans.
OutputFormat
RouteAction
Represents actions that can be performed on a route.
RouteStatus
Represents the current lifecycle status of a route.

Traits§

CommandDedupPort
EventPublisherPort
ProjectionStorePort
RouteController
Trait for managing route lifecycle operations.
RouteRepositoryPort
RuntimeEventJournalPort
RuntimeExecutionPort
RuntimeUnitOfWorkPort