pub struct SubscriptionOptions {
pub headers: Vec<(String, String)>,
}Expand description
Options to configure a subscription. headers are forwarded to the
broker as-is when sending the SUBSCRIBE frame and persisted locally so
they can be re-sent on reconnect. This allows broker-specific durable
subscription extensions to be used (for example ActiveMQ’s durable
subscription headers) while keeping the library generic.
§Durability
Durability is requested through headers, using whatever header the broker
defines for it - STOMP itself has no durable-subscription concept. For
example, ActiveMQ uses activemq.subscriptionName:
ⓘ
let options = SubscriptionOptions {
headers: vec![(
"activemq.subscriptionName".to_string(),
"my-durable-sub".to_string(),
)],
};On brokers where a durable queue is declared administratively, such as
RabbitMQ, pass that queue as the destination argument; nothing extra is
needed here.
Fields§
§headers: Vec<(String, String)>Extra headers to include on the SUBSCRIBE frame.
Trait Implementations§
Source§impl Clone for SubscriptionOptions
impl Clone for SubscriptionOptions
Source§fn clone(&self) -> SubscriptionOptions
fn clone(&self) -> SubscriptionOptions
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 moreSource§impl Debug for SubscriptionOptions
impl Debug for SubscriptionOptions
Source§impl Default for SubscriptionOptions
impl Default for SubscriptionOptions
Source§fn default() -> SubscriptionOptions
fn default() -> SubscriptionOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SubscriptionOptions
impl RefUnwindSafe for SubscriptionOptions
impl Send for SubscriptionOptions
impl Sync for SubscriptionOptions
impl Unpin for SubscriptionOptions
impl UnsafeUnpin for SubscriptionOptions
impl UnwindSafe for SubscriptionOptions
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