Skip to content

DeadLetterRedriver

Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:71

Redrives dead letters kept by a DeadLetterStore: rebuilds the request, dispatches it, then marks the record resolved — or, when the handling fails again, counts the attempt, keeps its error, and rethrows it. During a redrive, DeadLetterBehavior neither captures the failure again nor swallows it.

The application supplies the dispatch functions, one per request kind:

const redriver = new DeadLetterRedriver(store, {
requestTypes: [SendWelcomeEmailCommand, UserCreatedEvent],
dispatch: {
command: (command) => commands.execute(command),
// Only the failed handler, not every subscriber of the event.
event: (event, record) => eventHandlers[record.handlerName](event),
},
});
await redriver.redrive(recordId);

new DeadLetterRedriver(store, options): DeadLetterRedriver

Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:74

DeadLetterStore

DeadLetterRedriverOptions

DeadLetterRedriver

redrive(id): Promise<DeadLetterRedriveResult>

Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:87

Redrives the dead letter id.

string

Promise<DeadLetterRedriveResult>

DeadLetterRedriveError when it cannot be redriven; nothing is dispatched.

The handling error when the redrive fails; the attempt is counted.


resolve(id): Promise<void>

Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:137

Closes the dead letter id without replaying it.

string

Promise<void>