Wait for a single message, then cancel the underlying consumer. Pairs with get (zero-wait poll) and subscribe (long-lived):
get() — is there a message right now? null otherwise.consumeOne({ timeout }) — wait up to N ms for one message.subscribe(cb) — keep delivering until cancelled.Throws when timeout elapses with no delivery — distinct from get()'s
null return, so callers can't conflate "nothing" with "deadline missed".
The library acks the delivered message before resolving and uses
wire-level noAck: false with prefetch: 1 so the broker holds the
queue at a single in-flight delivery; messages beyond the one returned
stay in the queue for the next consumer.
Optionaltimeout?: numbermax wait in milliseconds (omit to wait forever)
Delete this queue.
Optionalparams: { ifEmpty?: boolean; ifUnused?: boolean }OptionalifEmpty?: booleanonly delete if the queue is empty
OptionalifUnused?: booleanonly delete if the queue has no consumers
Poll the queue for a single message.
Optionalparams: { noAck?: boolean }OptionalnoAck?: booleanautomatically acknowledge on delivery
Publish a message directly to this queue (via the default 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.
publish properties; set confirm: false to skip broker confirmation
this for chaining
Purge all messages from this queue.
Subscribe with a callback. Messages are acked after the callback returns, nacked on error.
Subscribe with a callback and custom params.
Subscribe via an async iterator. Messages continue yielding across reconnections.
Optionalparams: QueueSubscribeParams
High-level queue handle returned by AMQPSession#queue.
All operations are reconnect-safe: they acquire a session channel on each call, so they work transparently after a reconnection.
subscribeprovides automatic consumer recovery.publishwaits for a broker confirm; use Pass{ confirm: false }to skip the wait.