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:
Example
Section titled “Example”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);Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DeadLetterRedriver(
store,options):DeadLetterRedriver
Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:74
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”DeadLetterRedriver
Methods
Section titled “Methods”redrive()
Section titled “redrive()”redrive(
id):Promise<DeadLetterRedriveResult>
Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:87
Redrives the dead letter id.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<DeadLetterRedriveResult>
Throws
Section titled “Throws”DeadLetterRedriveError when it cannot be redriven; nothing is dispatched.
Throws
Section titled “Throws”The handling error when the redrive fails; the attempt is counted.
resolve()
Section titled “resolve()”resolve(
id):Promise<void>
Defined in: packages/pipeline-deadletter/src/dead-letter.redriver.ts:137
Closes the dead letter id without replaying it.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>