Skip to main content

CloudEventsReceiverParameters

@webda/cloudevents


Class: CloudEventsReceiverParameters

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:106

Parameters of the CloudEventsReceiver

Extends​

  • ServiceParameters

Constructors​

Constructor​

new CloudEventsReceiverParameters(): CloudEventsReceiverParameters

Returns​

CloudEventsReceiverParameters

Inherited from​

ServiceParameters.constructor

Properties​

bearerToken?​

optional bearerToken?: string

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:163

Shared bearer token required in Authorization: Bearer <token> on incoming requests


dedupe​

dedupe: boolean

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:141

Acknowledge an event already handled with the same source and id without dispatching it again

Delivery is at-least-once: the sender retries an event it did not get a 2xx for, so a handler that succeeded but whose response was lost runs twice. The cache is in memory and per replica: it only covers the retries reaching the same replica, keep the handlers idempotent.

Default​

false

dedupeSize​

dedupeSize: number

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:153

Entries the dedupe cache keeps, the oldest are evicted first

Default​

10000

dedupeTtl​

dedupeTtl: number

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:147

Milliseconds a handled source + id is remembered by dedupe

Default​

3600000

filters?​

optional filters?: CloudEventFilterDefinition[]

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:131

Filters every event must match to be dispatched, in the CloudEvents Subscriptions dialects: exact, prefix, suffix, all, any and sql (CESQL)

An event not matching is acknowledged (202) without reaching the handlers.

Examples​

[{ "prefix": { "type": "com.acme." } }]
[{ "sql": "type = 'com.acme.order.created' AND subject LIKE 'eu-%'" }]

requireAuthentication?​

optional requireAuthentication?: boolean

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:159

Require an authenticated Webda session on incoming CloudEvent HTTP requests

Default​

false

strict​

strict: boolean

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:121

Strict validation of the received events: specversion must be 1.0, the required attributes non-empty and the optional ones well-formed (time RFC3339), on top of the SDK validation

Loose by default: the required attributes (specversion, type, source, id) must be strings.

Default​

false

type​

type: string

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

Type of the service

Inherited from​

ServiceParameters.type


url​

url: string

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:112

Path of the POST route receiving the events

Default​

"/cloudevents"

Methods​

load()​

load(params?): this

Defined in: cloudevents/src/services/cloudeventsreceiver.service.ts:168

Parameters​

params?​

any = {}

Returns​

this

Overrides​

ServiceParameters.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​

ServiceParameters.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​

ServiceParameters.with