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

    Class AMQPClient

    AMQP 0-9-1 client over TCP socket.

    Hierarchy

    • AMQPBaseClient
      • AMQPClient
    Index

    Constructors

    • Parameters

      • url: string

        uri to the server, example: amqp://user:passwd@localhost:5672/vhost

      • OptionaltlsOptions: AMQPTlsOptions

        optional TLS options

      • Optionallogger: null | Logger

        optional logger instance, defaults to null (no logging)

      Returns AMQPClient

    Properties

    blocked?: string
    bufferPool: AMQPView[] = []
    channelMax: number = 0
    channels: AMQPChannel[]
    closed: boolean = true
    closePromise?: [(value?: void) => void, (err: Error) => void]
    connectPromise?: [(conn: AMQPBaseClient) => void, (err: Error) => void]
    frameMax: number
    heartbeat: number
    host: string
    logger: undefined | Logger
    name?: string
    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
    onUpdateSecretOk?: (value?: void) => void
    password: string
    platform?: string
    port: number
    socket?: Socket
    textEncoder: TextEncoder = ...

    Used for string -> arraybuffer when publishing

    tls: boolean
    tlsOptions: undefined | AMQPTlsOptions
    username: string
    vhost: string

    Methods

    • Gracefully close the AMQP connection.

      Parameters

      • Optionalreason: string = ""

        might be logged by the server

      • code: number = 200

      Returns Promise<void>

    • Try establish a connection

      Returns Promise<AMQPBaseClient>

    • Parameters

      • newSecret: string
      • reason: string

      Returns Promise<unknown>