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