Skip to main content

camel_api/
lib.rs

1//! # rust-camel API
2//!
3//! Core Camel abstractions: exchanges, messages, body, errors, processors.
4//!
5//! Note: Component, Endpoint, Consumer, Producer traits are defined in
6//! `camel-component-api`. This crate focuses on data types and EIP abstractions.
7// TODO(API-006): Consider re-exporting Component, Endpoint, Consumer, Producer
8// from camel-component-api here for a unified API surface.
9
10pub mod aggregator;
11pub mod backoff;
12pub mod body;
13pub mod body_converter;
14pub mod circuit_breaker;
15pub mod claim_check;
16pub mod data_format;
17pub mod datasource;
18pub mod declarative;
19pub mod delayer;
20pub mod dynamic_router;
21pub mod endpoint_pipeline;
22pub mod error;
23pub mod error_handler;
24pub mod exchange;
25pub mod exchange_lookup;
26pub mod filter;
27pub mod from_body;
28pub mod function;
29pub mod health;
30pub mod idempotent;
31pub mod lifecycle;
32pub mod load_balancer;
33pub mod loop_eip;
34pub mod message;
35pub mod metrics;
36pub mod multicast;
37pub mod outcome_pipeline;
38pub mod outcome_segment;
39pub mod pipeline_outcome;
40pub mod platform;
41pub mod processor;
42pub mod producer;
43pub mod recipient_list;
44pub mod resequencer;
45pub mod route_controller;
46pub mod routing_slip;
47pub mod runtime;
48pub mod security_policy;
49pub mod splitter;
50pub mod step_lifecycle;
51pub mod stream_cache;
52pub mod supervision;
53pub mod template;
54pub mod throttler;
55pub mod unit_of_work;
56pub mod value;
57pub mod xml_convert;
58
59// Re-export core types at crate root for convenience.
60pub use aggregator::{AggregationFn, AggregatorConfig, CompletionCondition};
61pub use backoff::{BackoffConfig, BackoffState};
62pub use body::{Body, BoxAsyncRead, StreamBody, StreamMetadata};
63pub use body_converter::{BodyType, convert as convert_body};
64pub use circuit_breaker::CircuitBreakerConfig;
65pub use data_format::DataFormat;
66pub use datasource::{
67    DatasourceCatalog, DatasourceConfig, DatasourceHandle, PoolFactory, ResourceRef,
68};
69pub use declarative::{LanguageExpressionDef, ValueSourceDef};
70pub use delayer::DelayConfig;
71pub use dynamic_router::{DynamicRouterConfig, RouterExpression};
72pub use endpoint_pipeline::{CAMEL_SLIP_ENDPOINT, EndpointPipelineConfig, EndpointResolver};
73pub use error::CamelError;
74pub use error_handler::{
75    BoundaryKind, ErrorHandlerConfig, ExceptionDisposition, ExceptionPolicy,
76    ExceptionPolicyBuilder, HEADER_REDELIVERED, HEADER_REDELIVERY_COUNTER,
77    HEADER_REDELIVERY_MAX_COUNTER, PolicyId, RedeliveryPolicy, RetryOutcome, RetryableStep,
78    StepDisposition,
79};
80pub use security_policy::{
81    AuthorizationDecision, PRINCIPAL_AUDIENCE_KEY, PRINCIPAL_CLAIMS_KEY, PRINCIPAL_ISSUER_KEY,
82    PRINCIPAL_KEY, PRINCIPAL_ROLES_KEY, PRINCIPAL_SCOPES_KEY, PRINCIPAL_SUBJECT_KEY, Principal,
83    SecurityPolicy, SecurityPolicyConfig, store_principal_properties,
84};
85// Backwards compatibility re-export (deprecated)
86pub use claim_check::ClaimCheckRepository;
87#[allow(deprecated)]
88pub use error_handler::ExponentialBackoff;
89pub use exchange::{
90    CAMEL_STOP, Exchange, ExchangePattern, ORIGINAL_MESSAGE_EXTENSION, is_camel_stop,
91};
92pub use exchange_lookup::{ExchangeLookupPath, LookupPathError, PathSegment};
93pub use filter::FilterPredicate;
94pub use from_body::FromBody;
95pub use function::{
96    ExchangePatch, FunctionDefinition, FunctionDiff, FunctionId, FunctionInvocationError,
97    FunctionInvoker, FunctionInvokerSync, PatchBody,
98};
99pub use health::{AsyncHealthCheck, CheckResult, HealthReport, HealthSource, ServiceHealth};
100pub use idempotent::IdempotentRepository;
101pub use lifecycle::{HealthStatus, Lifecycle, ServiceStatus};
102pub use load_balancer::{LoadBalanceStrategy, LoadBalancerConfig};
103pub use message::Message;
104pub use metrics::{MetricsCollector, NoOpMetrics};
105pub use multicast::{MulticastAggregationFn, MulticastConfig, MulticastStrategy};
106pub use outcome_pipeline::OutcomePipeline;
107pub use outcome_segment::OutcomeSegment;
108pub use pipeline_outcome::PipelineOutcome;
109pub use platform::{
110    LeadershipEvent, LeadershipHandle, LeadershipService, NoopLeadershipService,
111    NoopPlatformService, NoopReadinessGate, PlatformError, PlatformIdentity, PlatformService,
112    ReadinessGate,
113};
114pub use processor::{
115    BoxProcessor, BoxProcessorExt, IdentityProcessor, Processor, ProcessorFn, SyncBoxProcessor,
116};
117pub use producer::ProducerContext;
118pub use resequencer::{
119    BatchCompletion, CapacityPolicy, GapPolicy, ResequenceMode, ResequencePolicyConfig,
120};
121pub use route_controller::{RouteAction, RouteController, RouteStatus};
122pub use routing_slip::{RoutingSlipConfig, RoutingSlipExpression};
123pub use runtime::{
124    CANONICAL_CONTRACT_DECLARATIVE_ONLY_STEPS, CANONICAL_CONTRACT_EXCLUDED_DECLARATIVE_STEPS,
125    CANONICAL_CONTRACT_NAME, CANONICAL_CONTRACT_RUST_ONLY_STEPS,
126    CANONICAL_CONTRACT_SUPPORTED_STEPS, CANONICAL_CONTRACT_VERSION, CanonicalConcurrencySpec,
127    CanonicalFieldLoss, CanonicalLossReport, CanonicalRouteSpec, RuntimeCommand, RuntimeCommandBus,
128    RuntimeCommandResult, RuntimeEvent, RuntimeHandle, RuntimeQuery, RuntimeQueryBus,
129    RuntimeQueryResult, canonical_contract_rejection_reason, canonical_contract_supports_step,
130};
131pub use splitter::{
132    AggregationStrategy, SplitExpression, SplitterConfig, StreamSplitConfig, StreamSplitFormat,
133    StreamingSplitExpression, fragment_exchange, split_body, split_body_json_array,
134    split_body_lines,
135};
136pub use step_lifecycle::{StepLifecycle, StepShutdownReason};
137pub use supervision::SupervisionConfig;
138pub use throttler::{ThrottleStrategy, ThrottlerConfig};
139pub use unit_of_work::UnitOfWorkConfig;
140pub use value::{Headers, Value, cmp_values};
141
142// Template types
143pub use template::{
144    RouteTemplateSpec, TemplateError, TemplateInstanceRecord, TemplateParameterSpec,
145    TemplatedRouteSpec,
146};