oa_gateway_stomp::config

Struct StompConfig

Source
pub struct StompConfig {
Show 14 fields pub broker: SocketAddr, pub host: String, pub login: Option<String>, pub passcode: Option<Secret>, pub destination_prefix: String, pub topics: Vec<String>, pub unwrap_ma_payloads: bool, pub reconnect: bool, pub reconnect_delay: Duration, pub connect_timeout: Duration, pub suppress_echo: bool, pub on_panic: OnPanic, pub max_frame_size: usize, pub tls: Option<ClientTls>,
}
Expand description

Runtime settings for a STOMP client session.

This is not the host TOML section. broker is already a SocketAddr; the host resolves the hostname before constructing this. There is no enabled flag here — spawning is the host’s decision.

Self::login and Self::passcode are None to omit those CONNECT headers, not to send blanks. Self::passcode is sent only when Self::login is set, and is a Secret so it cannot be printed by a Debug of this struct.

Fields§

§broker: SocketAddr§host: String

STOMP host header. ActiveMQ Classic typically wants /.

§login: Option<String>

CONNECT login. None omits the header.

§passcode: Option<Secret>

CONNECT passcode. Sent only when Self::login is Some.

§destination_prefix: String

Prepended to each topic to form a STOMP destination. A missing trailing slash is added by crate::DestinationMap.

§topics: Vec<String>

Engine topics (and STOMP dest suffixes) to bridge both ways.

§unwrap_ma_payloads: bool

Peel A-GRA Rx/Tx hex wrappers on inbound MESSAGE frames and publish wrapper plus inner as two envelopes.

§reconnect: bool

Retry the broker after a dropped session or a session Err.

§reconnect_delay: Duration

Sleep between reconnect attempts.

§connect_timeout: Duration

Budget for TCP connect and for the CONNECTED wait, each.

§suppress_echo: bool

Skip outbound SEND when the envelope is an echo of this adapter.

§on_panic: OnPanic

Panic in a session task: abort run, or treat as a failed session.

§max_frame_size: usize

Largest frame accepted from the broker. Bounds the read buffer and the content-length a peer can claim.

§tls: Option<ClientTls>

Wrap the broker connection in TLS. None dials plaintext, which is the default.

Trait Implementations§

Source§

impl Clone for StompConfig

Source§

fn clone(&self) -> StompConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StompConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StompConfig

Source§

fn default() -> Self

Local ActiveMQ defaults: 127.0.0.1:61613, host /, /topic/ + demo, unwrap and reconnect on, echo suppressed, panic aborts, one-second reconnect delay, five-second timeouts, DEFAULT_MAX_FRAME_SIZE.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more