Interface: Queue
Defined in: src/queue/queue.ts:6
Methods
assert()
assert():
Promise<Queue>
Defined in: src/queue/queue.ts:17
Verify the queue against the broker, according to the configured assertionMode.
Assert(default) — declare the queue; creates it if absent, throws on config mismatch.Check— verify the queue exists without creating it; throws if absent.Passive— no-op; no network call is made.
Subsequent calls return immediately once the first call completes successfully. Returns this to allow chaining.
Returns
Promise<Queue>
bindExchange()
bindExchange(
exchange,pattern,args?):Promise<Queue>
Defined in: src/queue/queue.ts:32
Bind this queue to an exchange. Asserts the queue first if it has not been asserted yet.
Parameters
| Parameter | Type | Description |
|---|---|---|
exchange | Exchange | Exchange to bind this queue to. |
pattern | string | Routing key pattern under which to bind. |
args? | BindingArgs | Optional AMQP headers or x-arguments for the binding. |
Returns
Promise<Queue>
createBatchConsumer()
createBatchConsumer<
T>(options?):Promise<BatchConsumer<T,Record<string,unknown>>>
Defined in: src/queue/queue.ts:46
Create batch consumer for current queue. By default, creates a new dedicated channel for the consumer. Pass a channel in options to use a specific one instead.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
options? | BatchConsumerOptions<T> |
Returns
Promise<BatchConsumer<T, Record<string, unknown>>>
createConsumer()
createConsumer<
T>(options?):Promise<Consumer<T,Record<string,unknown>>>
Defined in: src/queue/queue.ts:39
Create consumer for current queue. By default, creates a new dedicated channel for the consumer. Pass a channel in options to use a specific one instead.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
options? | ConsumerOptions<T> |
Returns
Promise<Consumer<T, Record<string, unknown>>>
createProducer()
createProducer<
T>(options?):Promise<Producer<T,T>>
Defined in: src/queue/queue.ts:58
Create producer for current queue. Publishes via the default RabbitMQ exchange, routing messages directly to this queue by name. By default, creates a new dedicated channel for the producer. Pass a channel in options to use a specific one instead.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ProducerOptions<T> & object | Optional producer options (serialization, routing key, hooks, …). Set options.isConfirmed to true to open the dedicated channel in confirm mode. Has no effect when options.channel is supplied. |
Returns
Promise<Producer<T, T>>
name()
name():
Promise<string>
Defined in: src/queue/queue.ts:23
Returns the name of the queue. Asserts the queue first if it has not been asserted yet.
Returns
Promise<string>