#[non_exhaustive]pub struct SubscriptionConfig { /* private fields */ }Expand description
Subscription configuration.
§In-flight sizing precedence
During SubscriptionConfig::apply_defaults the bus reconciles three
related inputs:
- If
backpressureis set, itsmax_in_flight/max_pending_acksseed the matching fields when those are still0. Setting bothbackpressure.max_in_flightandmax_in_flightto different non-zero values is a configuration error surfaced byvalidate. max_in_flightfalls back to1if still unset.max_pending_acksfalls back to2 * max_in_flight.- If
backpressurewas unset, one is synthesized from the resolvedmax_in_flight/max_pending_acks.
Implementations§
Source§impl SubscriptionConfig
impl SubscriptionConfig
Sourcepub fn builder(
topic: Topic,
consumer_group: ConsumerGroup,
) -> SubscriptionConfigBuilder
pub fn builder( topic: Topic, consumer_group: ConsumerGroup, ) -> SubscriptionConfigBuilder
Begin building a SubscriptionConfig for the given topic + group.
pub fn topic(&self) -> &Topic
pub fn consumer_group(&self) -> &ConsumerGroup
pub fn consumer_name(&self) -> &ConsumerName
pub fn ack_mode(&self) -> AckMode
pub fn ordering_mode(&self) -> Option<OrderingMode>
pub fn balance_mode(&self) -> Option<ConsumerBalanceMode>
pub fn guarantee(&self) -> Option<DeliveryGuarantee>
pub fn max_in_flight(&self) -> usize
pub fn max_pending_acks(&self) -> usize
pub fn max_retry(&self) -> usize
pub fn retry_backoff(&self) -> Duration
pub fn dead_letter_topic(&self) -> Option<&Topic>
pub fn backpressure(&self) -> Option<&BackpressurePolicy>
pub fn wildcard_topic(&self) -> bool
Source§impl SubscriptionConfig
impl SubscriptionConfig
Sourcepub fn apply_defaults(&mut self)
pub fn apply_defaults(&mut self)
Fill in zero-value fields with sensible defaults.
Sourcepub fn validate(&self) -> Result<(), EventBusError>
pub fn validate(&self) -> Result<(), EventBusError>
Check config consistency without mutating fields.
Call apply_defaults first, or use normalize_and_validate.
Sourcepub fn normalize_and_validate(&mut self) -> Result<(), EventBusError>
pub fn normalize_and_validate(&mut self) -> Result<(), EventBusError>
Apply defaults then validate. Recommended single-call entrypoint.
Trait Implementations§
Source§impl Clone for SubscriptionConfig
impl Clone for SubscriptionConfig
Source§fn clone(&self) -> SubscriptionConfig
fn clone(&self) -> SubscriptionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SubscriptionConfig
impl RefUnwindSafe for SubscriptionConfig
impl Send for SubscriptionConfig
impl Sync for SubscriptionConfig
impl Unpin for SubscriptionConfig
impl UnsafeUnpin for SubscriptionConfig
impl UnwindSafe for SubscriptionConfig
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