pub struct BrokerConfig {Show 13 fields
pub adapter: String,
pub name: String,
pub enabled: bool,
pub retries: u32,
pub retry_backoff: u64,
pub request_timeout: Option<u64>,
pub delivery_guarantee: DeliveryGuarantee,
pub commit_strategy: CommitStrategy,
pub dlq: DlqPolicy,
pub max_in_flight: usize,
pub consumer_group: Option<String>,
pub topics: Vec<String>,
pub subscriptions: Vec<String>,
}Expand description
Configuration shared by all message-broker adapters.
Concrete broker configs embed this struct so generic code can work through
BrokerConfigExt without knowing adapter-specific fields.
Fields§
§adapter: StringAdapter name used for registry selection.
name: StringLogical name for this configuration.
enabled: boolWhether this configuration is enabled.
retries: u32Number of retries for failed requests.
retry_backoff: u64Backoff between retry attempts in milliseconds.
request_timeout: Option<u64>Request timeout in milliseconds (None = use broker default).
delivery_guarantee: DeliveryGuaranteeRequested delivery semantics.
commit_strategy: CommitStrategyOffset/ack commit behavior.
dlq: DlqPolicyDead-letter queue policy.
max_in_flight: usizeMaximum number of in-flight messages.
consumer_group: Option<String>Broker-neutral consumer group name.
topics: Vec<String>Broker-neutral topic declarations.
subscriptions: Vec<String>Broker-neutral subscription subjects/topics. Empty means the consumer chooses at runtime.
Implementations§
Source§impl BrokerConfig
impl BrokerConfig
Sourcepub fn new(adapter: impl Into<String>) -> Self
pub fn new(adapter: impl Into<String>) -> Self
Create a broker config with the provided adapter name and shared defaults.
Sourcepub fn request_timeout_duration(&self) -> Option<Duration>
pub fn request_timeout_duration(&self) -> Option<Duration>
Return the request timeout as a Duration, if configured.
Sourcepub const fn retry_backoff_duration(&self) -> Duration
pub const fn retry_backoff_duration(&self) -> Duration
Return retry backoff as a Duration.
Trait Implementations§
Source§impl Clone for BrokerConfig
impl Clone for BrokerConfig
Source§fn clone(&self) -> BrokerConfig
fn clone(&self) -> BrokerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BrokerConfig
impl Debug for BrokerConfig
Source§impl Default for BrokerConfig
impl Default for BrokerConfig
Source§impl<'de> Deserialize<'de> for BrokerConfig
impl<'de> Deserialize<'de> for BrokerConfig
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>,
impl Eq for BrokerConfig
Source§impl PartialEq for BrokerConfig
impl PartialEq for BrokerConfig
Source§fn eq(&self, other: &BrokerConfig) -> bool
fn eq(&self, other: &BrokerConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BrokerConfig
Auto Trait Implementations§
impl Freeze for BrokerConfig
impl RefUnwindSafe for BrokerConfig
impl Send for BrokerConfig
impl Sync for BrokerConfig
impl Unpin for BrokerConfig
impl UnsafeUnpin for BrokerConfig
impl UnwindSafe for BrokerConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.