Skip to main content

Crate camel_component_controlbus

Crate camel_component_controlbus 

Source
Expand description

ControlBus component for managing route lifecycle.

This component allows routes to control other routes in the Camel context using the ControlBus EIP pattern. It provides operations like start, stop, suspend, resume, and restart for routes.

TODO(CTRL-001): SuspendRoute and ResumeRoute commands are dispatched to the runtime but route-level suspension/resumption semantics (pausing message consumption without stopping the route) depend on runtime support that may not be fully implemented in all components.

TODO(CTRL-002): The Status action returns only the route lifecycle status string. Full route statistics (total exchange count, failure count, mean processing time, last exchange timestamp) are not yet populated. A future Stats command should return a structured JSON body with these metrics.

§URI Format

controlbus:route?routeId=my-route&action=start&authorizedRoutes=my-route,other-route

§Parameters

  • routeId: The ID of the route to operate on. Required — declared statically in the URI. The CamelRouteId exchange header override is denied (exchange data is untrusted; see ADR-0032 and ADR-0034).
  • action: The action to perform: start, stop, suspend, resume, restart, status
  • authorizedRoutes: Comma-separated allowlist of route IDs this endpoint may target. Required — when absent the endpoint fails closed (every command rejected).

§Example

// Start a route
from("timer:start?period=60000")
    .to("controlbus:route?routeId=my-route&action=start");

// Get route status
from("direct:getStatus")
    .to("controlbus:route?routeId=my-route&action=status")
    .log("Status: ${body}");

Structs§

ControlBusComponent
The ControlBus component for managing route lifecycle.