@cloudamqp/amqp-client
    Preparing search index...

    Class AMQPBaseClientAbstract

    Base class for AMQPClients. Implements everything except how to connect, send data and close the socket

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • vhost: string
      • username: string
      • password: string
      • Optionalname: string

        name of the connection, set in client properties

      • Optionalplatform: string

        used in client properties

      • frameMax: number = MIN_FRAME_SIZE
      • heartbeat: number = 0
      • channelMax: number = 0
      • Optionallogger: null | Logger

        optional logger instance, defaults to undefined (no logging)

      Returns AMQPBaseClient

    Properties

    blocked?: string

    Set when the server has blocked publishing (connection.blocked reason).

    channelMax: number = 0

    Maximum number of channels negotiated with the server.

    channels: AMQPChannel[]

    Open channels, indexed by channel id.

    closed: boolean = true

    Whether the connection is closed.

    closePromise?: [(value?: void) => void, (err: Error) => void]
    connectPromise?: [(conn: AMQPBaseClient) => void, (err: Error) => void]
    frameMax: number

    Maximum frame size in bytes negotiated with the server.

    heartbeat: number

    Heartbeat interval in seconds.

    logger: undefined | Logger

    Logger instance, or undefined to disable logging.

    name?: string

    Connection name, visible in the RabbitMQ management UI.

    ondisconnect?: (error?: Error) => void

    Callback when connection is lost

    Type declaration

      • (error?: Error): void
      • Parameters

        • Optionalerror: Error

          The error that caused the disconnection, if any

        Returns void

    onerror: (error: AMQPError) => void

    Callback for connection-level errors.

    onUpdateSecretOk?: (value?: void) => void
    password: string

    Password for authentication.

    platform?: string

    Platform identifier sent in client properties.

    username: string

    Username for authentication.

    vhost: string

    Virtual host to connect to.

    Methods

    • Gracefully close the AMQP connection.

      Parameters

      • Optionalreason: string = ""

        might be logged by the server

      • code: number = 200

      Returns Promise<void>

    • Parameters

      • newSecret: string
      • reason: string

      Returns Promise<unknown>