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 data_format;
16pub mod datasource;
17pub mod declarative;
18pub mod delayer;
19pub mod dynamic_router;
20pub mod endpoint_pipeline;
21pub mod error;
22pub mod error_handler;
23pub mod exchange;
24pub mod exchange_lookup;
25pub mod filter;
26pub mod from_body;
27pub mod function;
28pub mod health;
29pub mod lifecycle;
30pub mod load_balancer;
31pub mod loop_eip;
32pub mod message;
33pub mod metrics;
34pub mod multicast;
35pub mod outcome_pipeline;
36pub mod outcome_segment;
37pub mod pipeline_outcome;
38pub mod platform;
39pub mod processor;
40pub mod producer;
41pub mod recipient_list;
42pub mod route_controller;
43pub mod routing_slip;
44pub mod runtime;
45pub mod security_policy;
46pub mod splitter;
47pub mod stream_cache;
48pub mod supervision;
49pub mod template;
50pub mod throttler;
51pub mod unit_of_work;
52pub mod value;
53pub mod xml_convert;
54
55// Re-export core types at crate root for convenience.
56pub use aggregator::{AggregationFn, AggregatorConfig, CompletionCondition};
57pub use backoff::{BackoffConfig, BackoffState};
58pub use body::{Body, BoxAsyncRead, StreamBody, StreamMetadata};
59pub use body_converter::{BodyType, convert as convert_body};
60pub use circuit_breaker::CircuitBreakerConfig;
61pub use data_format::DataFormat;
62pub use datasource::{
63    DatasourceCatalog, DatasourceConfig, DatasourceHandle, PoolFactory, ResourceRef,
64};
65pub use declarative::{LanguageExpressionDef, ValueSourceDef};
66pub use delayer::DelayConfig;
67pub use dynamic_router::{DynamicRouterConfig, RouterExpression};
68pub use endpoint_pipeline::{CAMEL_SLIP_ENDPOINT, EndpointPipelineConfig, EndpointResolver};
69pub use error::CamelError;
70pub use error_handler::{
71    BoundaryKind, ErrorHandlerConfig, ExceptionDisposition, ExceptionPolicy,
72    ExceptionPolicyBuilder, HEADER_REDELIVERED, HEADER_REDELIVERY_COUNTER,
73    HEADER_REDELIVERY_MAX_COUNTER, PolicyId, RedeliveryPolicy, RetryOutcome, RetryableStep,
74    StepDisposition,
75};
76pub use security_policy::{
77    AuthorizationDecision, PRINCIPAL_AUDIENCE_KEY, PRINCIPAL_CLAIMS_KEY, PRINCIPAL_ISSUER_KEY,
78    PRINCIPAL_KEY, PRINCIPAL_ROLES_KEY, PRINCIPAL_SCOPES_KEY, PRINCIPAL_SUBJECT_KEY, Principal,
79    SecurityPolicy, SecurityPolicyConfig, store_principal_properties,
80};
81// Backwards compatibility re-export (deprecated)
82#[allow(deprecated)]
83pub use error_handler::ExponentialBackoff;
84pub use exchange::{Exchange, ExchangePattern};
85pub use exchange_lookup::{ExchangeLookupPath, LookupPathError, PathSegment};
86pub use filter::FilterPredicate;
87pub use from_body::FromBody;
88pub use function::{
89    ExchangePatch, FunctionDefinition, FunctionDiff, FunctionId, FunctionInvocationError,
90    FunctionInvoker, FunctionInvokerSync, PatchBody,
91};
92pub use health::{AsyncHealthCheck, CheckResult, HealthReport, HealthSource, ServiceHealth};
93pub use lifecycle::{HealthStatus, Lifecycle, ServiceStatus};
94pub use load_balancer::{LoadBalanceStrategy, LoadBalancerConfig};
95pub use message::Message;
96pub use metrics::{MetricsCollector, NoOpMetrics};
97pub use multicast::{MulticastAggregationFn, MulticastConfig, MulticastStrategy};
98pub use outcome_pipeline::OutcomePipeline;
99pub use outcome_segment::OutcomeSegment;
100pub use pipeline_outcome::PipelineOutcome;
101pub use platform::{
102    LeadershipEvent, LeadershipHandle, LeadershipService, NoopLeadershipService,
103    NoopPlatformService, NoopReadinessGate, PlatformError, PlatformIdentity, PlatformService,
104    ReadinessGate,
105};
106pub use processor::{
107    BoxProcessor, BoxProcessorExt, IdentityProcessor, Processor, ProcessorFn, SyncBoxProcessor,
108};
109pub use producer::ProducerContext;
110pub use route_controller::{RouteAction, RouteController, RouteStatus};
111pub use routing_slip::{RoutingSlipConfig, RoutingSlipExpression};
112pub use runtime::{
113    CANONICAL_CONTRACT_DECLARATIVE_ONLY_STEPS, CANONICAL_CONTRACT_EXCLUDED_DECLARATIVE_STEPS,
114    CANONICAL_CONTRACT_NAME, CANONICAL_CONTRACT_RUST_ONLY_STEPS,
115    CANONICAL_CONTRACT_SUPPORTED_STEPS, CANONICAL_CONTRACT_VERSION, CanonicalConcurrencySpec,
116    CanonicalFieldLoss, CanonicalLossReport, CanonicalRouteSpec, RuntimeCommand, RuntimeCommandBus,
117    RuntimeCommandResult, RuntimeEvent, RuntimeHandle, RuntimeQuery, RuntimeQueryBus,
118    RuntimeQueryResult, canonical_contract_rejection_reason, canonical_contract_supports_step,
119};
120pub use splitter::{
121    AggregationStrategy, SplitExpression, SplitterConfig, StreamSplitConfig, StreamSplitFormat,
122    StreamingSplitExpression, fragment_exchange, split_body, split_body_json_array,
123    split_body_lines,
124};
125pub use supervision::SupervisionConfig;
126pub use throttler::{ThrottleStrategy, ThrottlerConfig};
127pub use unit_of_work::UnitOfWorkConfig;
128pub use value::{Headers, Value};
129
130// Template types
131pub use template::{
132    RouteTemplateSpec, TemplateError, TemplateInstanceRecord, TemplateParameterSpec,
133    TemplatedRouteSpec,
134};