OptionalbackoffMultiplier for exponential backoff (default: 2)
OptionalchannelMax channels the session may open on this connection (0 = unlimited).
Overrides any ?channelMax= in the URL.
OptionalcodersCoder registry for automatic message encoding/decoding.
OptionaldefaultDefault content-encoding applied to published messages when not set explicitly.
OptionaldefaultDefault content-type applied to published messages when not set explicitly.
OptionalframeMax AMQP frame size in bytes (minimum 8192). Overrides any ?frameMax= in
the URL.
OptionalheartbeatHeartbeat interval in seconds (0 disables). Overrides any ?heartbeat= in
the URL.
OptionalloggerLogger instance. Pass null to disable logging explicitly.
OptionalmaxMaximum delay in milliseconds between reconnection attempts (default: 30000)
OptionalmaxMaximum number of reconnection attempts — 0 means infinite (default: 0)
OptionalnameConnection name, shown in the RabbitMQ management UI. Overrides any
?name= in the URL.
OptionalonblockedFires when the broker blocks the connection from publishing — usually
triggered by a resource alarm (memory or disk) on the server. Subsequent
publishes reject with Connection blocked by server until the broker
unblocks. Use this to apply backpressure upstream.
OptionalondisconnectFires when the underlying connection drops, before the reconnect loop starts. Useful for visibility into the gap between disconnect and reconnect.
OptionalonfailedFires when max reconnect retries are exhausted.
OptionalonreturnFires when a mandatory: true publish is returned by the broker because
it had no route to a queue. The session wires this onto every channel it
opens for publishing, so a single handler covers all session publishes.
OptionalonunblockedFires when the broker lifts a previous block on the connection.
OptionalparsersParser registry for automatic message serialization/deserialization.
OptionalreconnectInitial delay in milliseconds before reconnecting (default: 1000)
OptionaltlsTLS options — only used when connecting via amqp/amqps
OptionalvhostAMQP virtual host. For WebSocket URLs the URL path is the relay endpoint,
not the vhost — use this option to specify the vhost explicitly.
Defaults to "/" for WebSocket connections and to the URL path for TCP connections.
OptionalonconnectFires after a successful (re)connection — both the initial connect and
every reconnect after consumer recovery completes. Registering here
rather than after connect() resolves means a single handler covers
both code paths.
The session is passed in because on the initial connect this fires
before the connect() call returns, so closures over the outer
session variable would still see undefined. Use the argument —
it's the same instance either way.
Fire-and-forget. If your handler does async setup that the rest of
your code depends on, drive it yourself (e.g. await setup(session)
after connect() resolves) and use onconnect to re-run it on
reconnects.
Options for AMQPSession.connect.