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