Crate oa_gateway_stomp

Source
Expand description

STOMP 1.2 client adapter for ActiveMQ Classic (and any STOMP broker).

This is a client, not a server, and it is not JMS. Java CAL peers still speak OpenWire; ActiveMQ routes the same topic between OpenWire and STOMP when destinations match. The engine sees only oa_gateway_core::Envelope values. This crate maps /topic/{name} onto oa_gateway_core::RouteKey::topic and stamps oag.* headers so a MESSAGE is not SENDed back to the broker that just delivered it.

StompAdapter::serve (and oa_gateway_adapter::Adapter::run) connect, subscribe the configured topics both ways, and retry while StompConfig::reconnect is set. A panic in a session is isolated on a child task; StompConfig::on_panic chooses abort or reconnect. The host does not restart a finished run.

The codec (Frame, decode_one) is public so tests can speak STOMP without this adapter.

Modulesยง

  • adapter ๐Ÿ”’
    ActiveMQ STOMP client adapter. Protocol control stays here; data crosses the engine.
  • client ๐Ÿ”’
    TCP STOMP session: handshake, framed read/write.
  • codec ๐Ÿ”’
    STOMP 1.2 frames. Text commands and headers; opaque body bytes.
  • config ๐Ÿ”’
  • dest ๐Ÿ”’
    STOMP destination โ†” engine RouteKey mapping.
  • secret ๐Ÿ”’
    A string that must not reach a log.

Structsยง

  • /topic/ prefix used by ActiveMQ STOMP for JMS topics.
  • One STOMP frame (command + headers + body).
  • Wraps a credential โ€” the STOMP passcode โ€” so a stray Debug or Display on a config struct cannot print it.
  • STOMP client that bridges configured topics both ways.
  • Runtime settings for a STOMP client session.

Enumsยง

  • Why a frame could not be decoded, or why a write failed.
  • What an adapter does when its session task panics.

Constantsยง

  • Largest single frame (header block plus body) accepted from a peer.
  • Envelope crate::MessageId, written on outbound frames.
  • Which adapter last published this envelope onto the engine.
  • STOMP destination as received. Stamped inbound; stripped on outbound because stomp.* headers are not copied.
  • Engine topic, copied onto a native frame when the protocol has a place for it.
  • Engine type hint, copied onto a native frame when present.

Functionsยง