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

    Class AMQPGeneratorSubscription

    A persistent queue subscription that yields messages via an async iterator. Returned by AMQPSession.subscribe when no callback is provided.

    Bridges across reconnections — the iterator continues yielding after each reconnect without the caller needing to re-subscribe.

    const sub = await session.subscribe("my-queue", { noAck: true })
    for await (const msg of sub) {
    console.log(msg.bodyString())
    }

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    consumer: AMQPConsumer
    def: ConsumerDefinition
    onCancel?: () => void

    Accessors

    • get consumerTag(): string

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

      Returns string

    Methods