Interface ConnectionOptions

interface ConnectionOptions {
    acquireTimeout?: number;
    connectionName?: string;
    connectionTimeout?: number;
    frameMax?: number;
    heartbeat?: number;
    hostname?: string;
    hosts?: string[];
    maxChannels?: number;
    noDelay?: boolean;
    password?: string;
    port?: string | number;
    retryHigh?: number;
    retryLow?: number;
    socket?: TcpSocketConnectOpts;
    tls?: boolean | ConnectionOptions;
    url?: string;
    username?: string;
    vhost?: string;
}

Properties

acquireTimeout?: number

Milliseconds to wait before aborting a Channel creation attempt, i.e. acquire()

20_000
connectionName?: string

Custom name for the connection, visible in the server's management UI

connectionTimeout?: number

Max wait time, in milliseconds, for a connection attempt

10_000
frameMax?: number

Max size, in bytes, of AMQP data frames. Protocol max is 2^32-1. Actual value is negotiated with the server.

4096
heartbeat?: number

Period of time, in seconds, after which the TCP connection should be considered unreachable. Server may have its own max value, in which case the lowest of the two is used. A value of 0 will disable this feature. Heartbeats are sent every heartbeat / 2 seconds, so two missed heartbeats means the connection is dead.

60
hostname?: string
hosts?: string[]

"hostname:port" of multiple nodes in a cluster

maxChannels?: number

Maximum active AMQP channels. 65535 is the protocol max. The server may also have a max value, in which case the lowest of the two is used.

2047
noDelay?: boolean

Disable Nagle's algorithm for reduced latency. Disabling Nagle’s algorithm will enable the application to have many small packets in flight on the network at once, instead of a smaller number of large packets, which may increase load on the network, and may or may not benefit the application performance.

password?: string
port?: string | number
retryHigh?: number

Max delay, in milliseconds, for exponential-backoff when reconnecting

30_000
retryLow?: number

Step size, in milliseconds, for exponential-backoff when reconnecting

1000
socket?: TcpSocketConnectOpts

Additional options when creating the TCP socket with net.connect().

tls?: boolean | ConnectionOptions

Enable TLS, or set TLS specific options like overriding the CA for self-signed certificates. Automatically enabled if url starts with "amqps:"

url?: string

May also include params: heartbeat, connection_timeout, channel_max

"amqp://guest:guest@localhost:5672"
username?: string
vhost?: string