A persistent queue subscription that yields messages via an async iterator. Returned by AMQPQueue.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())} Copy
const sub = await session.subscribe("my-queue", { noAck: true })for await (const msg of sub) { console.log(msg.bodyString())}
Protected
Readonly
The underlying channel. Reflects the most recent channel after a reconnect.
The consumer tag. Reflects the most recent tag after a reconnect.
Cancel the subscription and remove it from session auto-recovery. Safe to call on a closed channel.
A persistent queue subscription that yields messages via an async iterator. Returned by AMQPQueue.subscribe when no callback is provided.
Bridges across reconnections — the iterator continues yielding after each reconnect without the caller needing to re-subscribe.
Example