pub struct ConsumerOptionsBuilder { /* private fields */ }Expand description
Builder for ConsumerOptions
Implementations§
Source§impl ConsumerOptionsBuilder
impl ConsumerOptionsBuilder
Sourcepub fn consumer_tag<S: Into<String>>(self, tag: S) -> Self
pub fn consumer_tag<S: Into<String>>(self, tag: S) -> Self
Set consumer tag
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Set concurrency level
Sourcepub fn prefetch_count(self, count: u16) -> Self
pub fn prefetch_count(self, count: u16) -> Self
Set prefetch count
Sourcepub fn no_prefetch_limit(self) -> Self
pub fn no_prefetch_limit(self) -> Self
Disable prefetch limit
Sourcepub fn auto_declare_queue(self) -> Self
pub fn auto_declare_queue(self) -> Self
Enable auto-declare queue
Sourcepub fn auto_declare_exchange(self) -> Self
pub fn auto_declare_exchange(self) -> Self
Enable auto-declare exchange and bind to queue
Sourcepub fn exchange_name<S: Into<String>>(self, name: S) -> Self
pub fn exchange_name<S: Into<String>>(self, name: S) -> Self
Set exchange name (if not set, uses queue_name)
Sourcepub fn exchange_options(self, options: CustomExchangeDeclareOptions) -> Self
pub fn exchange_options(self, options: CustomExchangeDeclareOptions) -> Self
Set exchange options
Sourcepub fn routing_key<S: Into<String>>(self, key: S) -> Self
pub fn routing_key<S: Into<String>>(self, key: S) -> Self
Set routing key for binding (default: queue_name)
Sourcepub fn queue_options(self, options: CustomQueueDeclareOptions) -> Self
pub fn queue_options(self, options: CustomQueueDeclareOptions) -> Self
Set queue options
Sourcepub fn retry_policy(self, policy: RetryPolicy) -> Self
pub fn retry_policy(self, policy: RetryPolicy) -> Self
Set retry policy
Sourcepub fn dead_letter_exchange<S: Into<String>>(self, exchange: S) -> Self
pub fn dead_letter_exchange<S: Into<String>>(self, exchange: S) -> Self
Set dead letter exchange
Sourcepub fn manual_ack(self) -> Self
pub fn manual_ack(self) -> Self
Enable manual ack (recommended for production)
Sourcepub fn high_throughput(self) -> Self
pub fn high_throughput(self) -> Self
Configure for high throughput
Sourcepub fn development(self) -> Self
pub fn development(self) -> Self
Configure for development (simpler settings)
Sourcepub fn minutes_retry(self) -> Self
pub fn minutes_retry(self) -> Self
Configure for minutes exponential retry (1min, 2min, 4min, 8min, 16min - max 5 retries) This preset automatically sets up:
- Auto declare queue and exchange
- Retry policy with minutes exponential backoff
- Dead letter exchange/queue based on queue name
- Reliable processing settings
Sourcepub fn build(self) -> ConsumerOptions
pub fn build(self) -> ConsumerOptions
Build the final configuration
Trait Implementations§
Source§impl Clone for ConsumerOptionsBuilder
impl Clone for ConsumerOptionsBuilder
Source§fn clone(&self) -> ConsumerOptionsBuilder
fn clone(&self) -> ConsumerOptionsBuilder
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 moreAuto Trait Implementations§
impl Freeze for ConsumerOptionsBuilder
impl RefUnwindSafe for ConsumerOptionsBuilder
impl Send for ConsumerOptionsBuilder
impl Sync for ConsumerOptionsBuilder
impl Unpin for ConsumerOptionsBuilder
impl UnwindSafe for ConsumerOptionsBuilder
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