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

    Class AMQPSubscription

    A persistent queue subscription returned by AMQPQueue.subscribe.

    Remains valid across reconnections — the underlying channel and consumer tag are swapped in-place after each reconnect. Use cancel() to unsubscribe and remove from auto-recovery.

    Hierarchy (View Summary)

    Index

    Properties

    Accessors

    Methods

    Properties

    consumer: AMQPConsumer

    Accessors

    • get consumerTag(): string

      The consumer tag. Reflects the most recent tag after a reconnect.

      Returns string

    Methods

    • Cancel the subscription, close its dedicated channel, and remove it from session auto-recovery.

      The subscription owns the channel that queue.subscribe() opened for it, so cancelling here also closes that channel — otherwise each cancelled subscription leaks a channel until the connection drops.

      Best-effort: never throws on wire-level failures. If the channel dropped mid-cancel or the broker is gone, the consumer is already effectively dead — there's nothing for the caller to recover from, so swallowing the error means call sites don't need .catch(() => {}) boilerplate around every cancel.

      Returns Promise<void>