ReadonlyclientUnderlying transport. Exposed for state inspection (e.g. client.closed)
and test access. Do not open channels on this directly, and do not
overwrite client.ondisconnect — the session uses it to drive reconnection.
OptionalonconnectFires after a successful (re)connection and consumer recovery
OptionalonfailedFires when max retries are exhausted
Stop the session: cancel reconnection, clear consumer tracking, and close the underlying connection.
Optionalreason: stringSubscribe to a queue with automatic consumer recovery on reconnection. Messages will be delivered asynchronously to the callback.
queue name or AMQPQueue object
consume parameters (noAck, exclusive, tag, args)
called for each delivered message
Optionaloptions: SubscribeOptionsqueue declaration and prefetch settings for recovery
Subscribe to a queue with automatic consumer recovery on reconnection. Messages will be delivered through an async-iterable subscription that continues yielding across reconnections.
queue name or AMQPQueue object
consume parameters (noAck, exclusive, tag, args)
Optionalcallback: undefinedOptionaloptions: SubscribeOptionsqueue declaration and prefetch settings for recovery
StaticconnectConnect to an AMQP broker and return a session with automatic reconnection.
The transport is chosen from the URL scheme:
amqp:// / amqps:// → TCP socket (AMQPClient)ws:// / wss:// → WebSocket (AMQPWebSocketClient)Optionaloptions: AMQPSessionOptions
High-level session with automatic reconnection and consumer recovery.
Create via
AMQPSession.connect(url, options). The session owns its underlying transport; usesession.clientonly to inspect state, not to open channels directly.