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