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

    Class AMQPExchange<P, C, KP, KC>

    Session-level exchange handle returned by AMQPSession#exchange and its convenience variants (AMQPSession#directExchange, etc.).

    All operations are reconnect-safe: they acquire a session channel on each call. publish waits for a broker confirm; pass { confirm: false } to skip the wait.

    Type Parameters

    • P extends ParserMap = {}
    • C extends CoderMap = {}
    • KP extends keyof P & string = never
    • KC extends keyof C & string = never
    Index

    Properties

    Methods

    Properties

    name: string

    Exchange name.

    Methods

    • Delete this exchange.

      Parameters

      • Optionalparams: { ifUnused?: boolean }
        • OptionalifUnused?: boolean

          only delete if the exchange has no bindings

      Returns Promise<void>

    • Publish a message to this exchange.

      When the session has parsers configured, body can be any value accepted by the matching parser's serialize method. Without parsers, body must be a string, Buffer, Uint8Array, or null.

      Defaults: confirm: true, deliveryMode: 2 (persistent). Pass deliveryMode: 1 to send a transient message.

      Type Parameters

      • O extends string = KP

      Parameters

      Returns Promise<AMQPExchange<P, C, KP, KC>>

      this for chaining