Expand description
Mini STOMP broker, a peer client, and an adapter starter.
start_mini_broker is an in-process stand-in for ActiveMQ
Classic: exact-destination fan-out, no auth, no persistence, no
heartbeats. Most tests need no Docker. start_stomp_adapter
turns reconnect off so a failed session fails the test instead of
looping. Helpers panic on timeout or a surprising frame.
StructsΒ§
- Broker
State πDestinations β subscribers, plus a process-widemessage-id. - In-process STOMP 1.2 broker on an ephemeral port.
- Raw STOMP client for tests: CONNECT, SUBSCRIBE, SEND, recv.
- Sub πOne SUBSCRIBE: which connection, which
id, and where to write MESSAGE frames.
FunctionsΒ§
- dispatch πHandles one client frame. Unknown commands get an ERROR. SEND copies headers except
destinationand assignsmessage-id. - handle_
conn πReads frames until the peer closes orshutdownfires, then drops this connectionβs subscriptions. - run_
broker πAccepts connections untilshutdown. Each socket is its own task. - Binds
127.0.0.1:0and serves untilMiniBroker::shutdown. - As
start_mini_broker_tls, but the broker also requires and verifies a client certificate issued byclient_cafrom every connection. - As
start_mini_broker, but the broker terminates TLS withcerts. - Starts
StompAdaptertowardbrokerand waits until it is subscribed. - As
start_stomp_adapter, with the config open for editing first β for example to setStompConfig::tls.