Skip to main content

AMQPQueueParameters

@webda/amqp


Class: AMQPQueueParameters

Defined in: amqp/src/queue.service.ts:8

Configuration for AMQPQueue

Extends​

  • QueueParameters

Constructors​

Constructor​

new AMQPQueueParameters(): AMQPQueueParameters

Returns​

AMQPQueueParameters

Inherited from​

QueueParameters.constructor

Properties​

idleDelayer?​

optional idleDelayer?: WaitDelayerDefinition

Defined in: core/lib/queues/queueservice.d.ts:47

Delayer between two receives of the main consumer while the queue returns no message

Queues answering immediately when empty (PostgresQueue, AMQPQueue...) would otherwise be polled in a tight loop. The delay grows with the consecutive empty receives, up to maxIdleDelay; the time spent in the receive is deducted, so long-polling queues (SQSQueue, FileQueue, MemoryQueue with a timeout) are not slowed down.

Default​

{ "type": "exponential", "interval": 50 }

Inherited from​

QueueParameters.idleDelayer


maxConsumers​

maxConsumers: number

Defined in: core/lib/queues/queueservice.d.ts:37

Max number of queue consumers Queue will auto increase to this max number if queue is loaded and it will decrease to just one consumer if no messages are available

Default​

10

Inherited from​

QueueParameters.maxConsumers


maxIdleDelay?​

optional maxIdleDelay?: number

Defined in: core/lib/queues/queueservice.d.ts:56

Maximum delay between two receives while the queue stays empty, in milliseconds

It bounds the extra latency of the first message after an idle period, and the polling rate of an idle consumer (4 receives per second at 250ms).

Default​

250

Inherited from​

QueueParameters.maxIdleDelay


push?​

optional push?: boolean

Defined in: amqp/src/queue.service.ts:33

Subscribe with basic.consume instead of polling with basic.get

consume() opens its own channel with a prefetch of maxConsumers: the broker pushes the messages as they arrive, at most maxConsumers being processed at once. A message whose callback fails is requeued after the workerDelayer delay, so it is delivered again. Set to false to poll with receiveMessage.

Default​

true

queue​

queue: string

Defined in: amqp/src/queue.service.ts:19

Queue name


queueOptions?​

optional queueOptions?: any

Defined in: amqp/src/queue.service.ts:23

Options passed to assertQueue


type​

type: string

Defined in: core/lib/services/serviceparameters.d.ts:9

Type of the service

Inherited from​

QueueParameters.type


url​

url: string | SecretString

Defined in: amqp/src/queue.service.ts:15

AMQP connection url

Can be encrypted with webda config encrypt

Example​

"amqp://localhost:5672"

workerDelayer?​

optional workerDelayer?: WaitDelayerDefinition

Defined in: core/lib/queues/queueservice.d.ts:24

Delayer between two failed attempts to process messages

Inherited from​

QueueParameters.workerDelayer


workerParallelism​

workerParallelism: boolean

Defined in: core/lib/queues/queueservice.d.ts:29

Define if worker should process multi message received in //

Default​

true

Inherited from​

QueueParameters.workerParallelism

Methods​

load()​

load(params?): this

Defined in: amqp/src/queue.service.ts:40

Parameters​

params?​

any = {}

the input parameters

Returns​

this

this

Overrides​

QueueParameters.load


update()​

update(params, delta): this

Defined in: core/lib/application/parameters.d.ts:21

Update parameters and call watchers if a parameter was changed

Parameters​

params​

any

the service parameters

delta​

any

the delta

Returns​

this

this for chaining

Inherited from​

QueueParameters.update


with()​

with(callback): this

Defined in: core/lib/application/parameters.d.ts:27

Watch for changes on the parameters and call watchers when a parameter is changed

Parameters​

callback​

(params) => void

the callback function

Returns​

this

this for chaining

Inherited from​

QueueParameters.with