Μετάβαση στο περιεχόμενο

DeadLetterBehaviorOptions

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:34

Per-handler (and constructor-default) options for DeadLetterBehavior.

Supplied per handler via pipeline.wrap(options, [DeadLetterBehavior, { ... }]), shallow-merged over the constructor defaults (handler keys win), except that ignoreErrors and redactKeys set at both levels are combined.

Fire-and-forget event capture

class UserCreatedHandler {
@pipeline.wrap({ kind: 'event' }, [DeadLetterBehavior, {
captureKinds: ['event'],
rethrow: false,
redactKeys: ['token'],
}])
async handle(event: UserCreatedEvent) {}
}

optional captureKinds?: DeadLetterRequestKind[]

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:58

Request kinds to capture. Default ['event']: a command’s or query’s caller already receives the error. Example: ['command', 'event'] to also keep failed commands.


optional ignoreErrors?: (Constructor<unknown> | ((…args) => unknown))[] | ((error, context) => boolean)

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:65

Filter predicate or error types to ignore. Matching errors are re-thrown without being sent to the dead-letter transport. Useful for ignoring expected client validation errors (e.g. ZodValidationError).


optional includeStack?: boolean

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:51

Include the error stack trace in the record. Default true. Set false to keep records lean or avoid leaking internals downstream.


optional metadata?: DeadLetterMetadataFactory

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:70

Produce extra metadata to merge into the dead-letter record.


optional redact?: (payload) => unknown

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:76

Custom redactor function for the captured request payload. When supplied, takes precedence over redactKeys.

unknown

unknown


optional redactKeys?: string[]

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:82

Field names to mask with [REDACTED] in the captured request payload. Case-insensitive matching. Merged on top of DEFAULT_REDACT_KEYS.


optional rethrow?: boolean

Defined in: packages/pipeline-deadletter/src/interfaces/dead-letter-options.interface.ts:45

Whether to re-throw the original error after dead-lettering.

  • true (default) — propagate after the capture decision; the caller sees the failure (HTTP 5xx, command rejection, …). Use for commands/queries.
  • false — on an event handler only, swallow the error when it is captured and the transport delivers it; the pipeline then resolves to undefined and the swallow is logged at error level with the record id. On a command or query handler it is a contract diagnostic and is ignored.