pub struct AmqpConfig {
pub url: String,
pub queue: Option<String>,
pub subscribe_mode: bool,
pub username: Option<String>,
pub password: Option<String>,
pub tls: TlsConfig,
pub exchange: Option<String>,
pub prefetch_count: Option<u16>,
pub no_persistence: bool,
pub no_declare_queue: bool,
pub delayed_ack: bool,
}Expand description
General AMQP connection configuration.
Fields§
§url: StringAMQP connection URI. The lapin client connects to a single host specified in the URI.
For high availability, provide the address of a load balancer or use DNS resolution
that points to multiple brokers. Example: “amqp://localhost:5672/vhost”.
queue: Option<String>The AMQP queue name.
subscribe_mode: bool(Consumer only) If true, act as a Subscriber (fan-out). Defaults to false.
username: Option<String>Optional username for authentication.
password: Option<String>Optional password for authentication.
tls: TlsConfigTLS configuration.
exchange: Option<String>The exchange to publish to or bind the queue to.
prefetch_count: Option<u16>(Consumer only) Number of messages to prefetch. Defaults to 100.
no_persistence: boolIf true, declare queues as non-durable (transient). Defaults to false. Affects both Consumer (queue durability) and Publisher (message persistence).
no_declare_queue: bool(Publisher only) If true, do not attempt to declare the queue. Assumes the queue already exists. Defaults to false.
delayed_ack: bool(Publisher only) If true, do not wait for an acknowledgement when sending to broker. Defaults to false.
Implementations§
Source§impl AmqpConfig
impl AmqpConfig
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Creates a new AMQP configuration with the specified connection URL.
pub fn with_queue(self, queue: impl Into<String>) -> Self
pub fn with_exchange(self, exchange: impl Into<String>) -> Self
pub fn with_credentials( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl Clone for AmqpConfig
impl Clone for AmqpConfig
Source§fn clone(&self) -> AmqpConfig
fn clone(&self) -> AmqpConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more