pub struct RabbitMqConfig {
pub url: String,
pub virtual_host: String,
pub prefetch_count: u16,
pub session_lock_duration: Duration,
pub message_ttl: Option<Duration>,
pub enable_dead_letter: bool,
pub dead_letter_exchange: Option<String>,
}Expand description
RabbitMQ provider configuration using AMQP 0-9-1
§Examples
use queue_runtime::RabbitMqConfig;
use chrono::Duration;
let config = RabbitMqConfig {
url: "amqp://guest:guest@localhost:5672".to_string(),
virtual_host: "/".to_string(),
prefetch_count: 10,
session_lock_duration: Duration::minutes(5),
message_ttl: None,
enable_dead_letter: true,
dead_letter_exchange: Some("dlx".to_string()),
};Fields§
§url: StringAMQP connection URL (e.g. amqp://user:pass@host:port/vhost)
virtual_host: StringRabbitMQ virtual host (defaults to /)
prefetch_count: u16Number of messages to prefetch per channel (0 = unlimited)
session_lock_duration: DurationDuration to hold a session lock before expiry
message_ttl: Option<Duration>Default message time-to-live
enable_dead_letter: boolWhether to enable dead letter queue routing
dead_letter_exchange: Option<String>Name of the dead letter exchange (required when enable_dead_letter is true)
Trait Implementations§
Source§impl Clone for RabbitMqConfig
impl Clone for RabbitMqConfig
Source§fn clone(&self) -> RabbitMqConfig
fn clone(&self) -> RabbitMqConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RabbitMqConfig
impl Debug for RabbitMqConfig
Source§impl Default for RabbitMqConfig
impl Default for RabbitMqConfig
Source§impl<'de> Deserialize<'de> for RabbitMqConfig
impl<'de> Deserialize<'de> for RabbitMqConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RabbitMqConfig
impl RefUnwindSafe for RabbitMqConfig
impl Send for RabbitMqConfig
impl Sync for RabbitMqConfig
impl Unpin for RabbitMqConfig
impl UnsafeUnpin for RabbitMqConfig
impl UnwindSafe for RabbitMqConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
impl<D> DeserializeWith<JsonFormat> for Dwhere
D: DeserializeOwned,
Source§fn deserialize_with(body: ResponseBody) -> Result<D, Error>
fn deserialize_with(body: ResponseBody) -> Result<D, Error>
Deserialize the response body using the specified format. Read more