amqpx / index / QueueImplementation
Class: QueueImplementation
Defined in: src/queue/queue-implementation.ts:18
Implements
Constructors
Constructor
new QueueImplementation(
channel,queueName,options?):QueueImplementation
Defined in: src/queue/queue-implementation.ts:22
Parameters
| Parameter | Type |
|---|---|
channel | Channel |
queueName | string |
options? | QueueOptions |
Returns
QueueImplementation
Methods
assert()
assert():
Promise<QueueImplementation>
Defined in: src/queue/queue-implementation.ts:34
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<QueueImplementation>
Implementation of
bindExchange()
bindExchange(
exchange,pattern,args?):Promise<QueueImplementation>
Defined in: src/queue/queue-implementation.ts:69
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<QueueImplementation>
Implementation of
createBatchConsumer()
createBatchConsumer<
T>(options?):Promise<BatchConsumer<T,Record<string,unknown>>>
Defined in: src/queue/queue-implementation.ts:81
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>>>
Implementation of
createConsumer()
createConsumer<
T>(options?):Promise<Consumer<T,Record<string,unknown>>>
Defined in: src/queue/queue-implementation.ts:75
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>>>
Implementation of
createProducer()
createProducer<
T>(options?):Promise<ProducerImplementation<T>>
Defined in: src/queue/queue-implementation.ts:87
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<ProducerImplementation<T>>
Implementation of
name()
name():
Promise<string>
Defined in: src/queue/queue-implementation.ts:65
Returns the name of the queue. Asserts the queue first if it has not been asserted yet.
Returns
Promise<string>