pub struct ConsumerConfig {
pub max_in_flight: i32,
pub max_attempts: u16,
pub dial_timeout: Duration,
pub read_timeout: Duration,
pub write_timeout: Duration,
pub lookup_poll_interval: Duration,
pub lookup_poll_jitter: f64,
pub max_requeue_delay: Duration,
pub default_requeue_delay: Duration,
pub shutdown_timeout: Duration,
pub backoff_strategy: bool,
pub disable_auto_response: bool,
}Fields§
§max_in_flight: i32§max_attempts: u16§dial_timeout: Duration§read_timeout: Duration§write_timeout: Duration§lookup_poll_interval: Duration§lookup_poll_jitter: f64§max_requeue_delay: Duration§default_requeue_delay: Duration§shutdown_timeout: Duration§backoff_strategy: bool是否使用指数退避策略进行重连
disable_auto_response: bool是否禁用自动响应
当设置为 true 时,消息不会根据 Handler 的返回值自动发送 FIN/REQ 需要在 Handler 中手动调用 message.finish() 或 message.requeue()
这对于以下场景很有用:
- 并发处理消息时需要异步确认
- 批量处理消息
- 需要精确控制消息确认时机
Trait Implementations§
Source§impl Clone for ConsumerConfig
impl Clone for ConsumerConfig
Source§fn clone(&self) -> ConsumerConfig
fn clone(&self) -> ConsumerConfig
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 ConsumerConfig
impl Debug for ConsumerConfig
Auto Trait Implementations§
impl Freeze for ConsumerConfig
impl RefUnwindSafe for ConsumerConfig
impl Send for ConsumerConfig
impl Sync for ConsumerConfig
impl Unpin for ConsumerConfig
impl UnwindSafe for ConsumerConfig
Blanket Implementations§
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