pub struct LapinAdapterConfig {
pub default_job_type: String,
pub include_payload: bool,
pub max_payload_size: usize,
pub job_type_extractor: Option<Arc<dyn Fn(&Delivery) -> String + Send + Sync>>,
pub job_id_extractor: Option<Arc<dyn Fn(&Delivery) -> String + Send + Sync>>,
pub metadata_extractor: Option<Arc<dyn Fn(&Delivery) -> Value + Send + Sync>>,
pub include_default_metadata: bool,
pub correlation_id_extractor: Option<Arc<dyn Fn(&Delivery) -> Option<String> + Send + Sync>>,
pub max_attempts: Option<i32>,
}Expand description
Configuration for the Queuerious lapin adapter.
Fields§
§default_job_type: StringDefault job type when not extractable from the message (default: “unknown”).
include_payload: boolWhether to include the message payload in events (default: false). May contain PII — enable with caution.
max_payload_size: usizeMaximum payload size in bytes to include (default: 65536 / 64 KB). Payloads exceeding this limit are replaced with a descriptive placeholder.
job_type_extractor: Option<Arc<dyn Fn(&Delivery) -> String + Send + Sync>>Custom function to extract the job type from a delivery.
job_id_extractor: Option<Arc<dyn Fn(&Delivery) -> String + Send + Sync>>Custom function to extract the job ID from a delivery. Defaults to using the delivery tag as a string.
metadata_extractor: Option<Arc<dyn Fn(&Delivery) -> Value + Send + Sync>>Custom function to extract metadata from a delivery. When set, this is used instead of the default metadata extraction.
include_default_metadata: boolWhether to include default AMQP metadata when no custom metadata_extractor is set (default: true).
correlation_id_extractor: Option<Arc<dyn Fn(&Delivery) -> Option<String> + Send + Sync>>Custom function to extract the correlation ID from a delivery.
When not set, the default extraction tries: AMQP correlation_id property,
x-correlation-id header, then JSON payload fields (correlation_id, correlationId).
max_attempts: Option<i32>Maximum retry attempts for this consumer. When set, included in job_started
events so the server can track attempt progress.
Trait Implementations§
Source§impl Clone for LapinAdapterConfig
impl Clone for LapinAdapterConfig
Source§fn clone(&self) -> LapinAdapterConfig
fn clone(&self) -> LapinAdapterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more