pub struct AggregatorConfig {
pub header_name: String,
pub completion: CompletionMode,
pub correlation: CorrelationStrategy,
pub strategy: AggregationStrategy,
pub max_buckets: Option<usize>,
pub bucket_ttl: Option<Duration>,
pub force_completion_on_stop: bool,
pub discard_on_timeout: bool,
pub max_timeout_tasks: usize,
}Expand description
Configuration for the Aggregator EIP.
Fields§
§header_name: StringName of the header used as correlation key.
completion: CompletionModeWhen to emit the aggregated exchange.
correlation: CorrelationStrategyStrategy for determining correlation keys.
strategy: AggregationStrategyHow to combine the bucket into one exchange.
max_buckets: Option<usize>Maximum number of correlation key buckets (memory protection). When limit is reached, new correlation keys are rejected.
bucket_ttl: Option<Duration>Time-to-live for inactive buckets (memory protection). Buckets not updated for this duration are evicted.
force_completion_on_stop: boolForce-complete all pending buckets when the route is stopped.
discard_on_timeout: boolDiscard bucket contents on timeout instead of emitting.
max_timeout_tasks: usizeMaximum number of concurrently-live per-bucket timeout tasks (DoS cap, R3-M3).
When the cap is reached, new buckets skip the dedicated timeout spawn and
rely on bucket_ttl eviction (graceful degradation under a key flood).
Default 1024.
Implementations§
Source§impl AggregatorConfig
impl AggregatorConfig
Sourcepub fn correlate_by(header: impl Into<String>) -> AggregatorConfigBuilder
pub fn correlate_by(header: impl Into<String>) -> AggregatorConfigBuilder
Start building config with correlation key extracted from the named header.
Sourcepub fn validate(&self) -> Result<(), CamelError>
pub fn validate(&self) -> Result<(), CamelError>
Validate that at least one memory-release bound is configured (R3-M2).
At least one of max_buckets, a Timeout completion condition, or
bucket_ttl MUST be set, otherwise a flood of unique correlation keys
grows the bucket map without limit (remote-OOM vector).
Additionally, when a Timeout completion condition is present,
bucket_ttl MUST also be set. The R3-M3 timeout-task cap may skip
spawning a dedicated timeout task under flood; without bucket_ttl
there is no fallback eviction path and the bucket leaks until shutdown.
Requiring bucket_ttl whenever Timeout is present makes the cap-skip
degradation safe by construction.
Trait Implementations§
Source§impl Clone for AggregatorConfig
impl Clone for AggregatorConfig
Source§fn clone(&self) -> AggregatorConfig
fn clone(&self) -> AggregatorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more