Skip to main content

PostgresQueueParameters

@webda/postgres


Class: PostgresQueueParameters

Defined in: postgres/src/postgresqueue.service.ts:10

Configuration for PostgresQueueService.

Extends​

  • QueueParameters

Constructors​

Constructor​

new PostgresQueueParameters(): PostgresQueueParameters

Returns​

PostgresQueueParameters

Inherited from​

QueueParameters.constructor

Properties​

autoCreateTable?​

optional autoCreateTable?: boolean

Defined in: postgres/src/postgresqueue.service.ts:56

Whether to auto-create the queue table on init.

Default​

true

batchSize?​

optional batchSize?: number

Defined in: postgres/src/postgresqueue.service.ts:38

Max number of messages pulled per receiveMessage call. The queue worker calls receiveMessage in a loop, so this is also the parallel batch size.

Default​

10

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


postgresqlServer?​

optional postgresqlServer?: ClientConfig | PoolConfig

Defined in: postgres/src/postgresqueue.service.ts:50

Connection settings forwarded to the chosen pg client/pool. Defaults to PG* environment variables.


table?​

optional table?: string

Defined in: postgres/src/postgresqueue.service.ts:21

Table name backing the queue. Auto-created on init if missing.

Default​

"webda_queue"

Pattern​

/^[a-zA-Z_][a-zA-Z0-9_]*$/

Examples​

"myapp_queue"
"user_notifications"
"cache_invalidation"
"orders"

type​

type: string

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

Type of the service

Inherited from​

QueueParameters.type


usePool?​

optional usePool?: boolean

Defined in: postgres/src/postgresqueue.service.ts:45

Whether to use a pg.Pool (recommended for shared workloads) or a single pg.Client.

Default​

true

visibilityTimeout?​

optional visibilityTimeout?: number

Defined in: postgres/src/postgresqueue.service.ts:30

Visibility timeout in seconds — how long a locked-but-undeleted message stays invisible to other consumers before being eligible for redelivery. Workers that crash mid-process without acking will see their messages reappear after this window.

Default​

30

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: postgres/src/postgresqueue.service.ts:63

Parameters​

params?​

any = {}

the input parameters

Returns​

this

this

Overrides​

QueueParameters.load


update()​

update(params, delta): this

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

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/services/serviceparameters.d.ts:31

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