Hermes MySQL
    Preparing search index...

    Type Alias ReactionConsumerParams

    ReactionConsumerParams: EventStoreConsumerBaseParams & {
        maxAttempts?: number;
        onGiveUp?: (
            event: RecordedEvent,
            error: unknown,
            context: ReactionContext<PoolConnection>,
        ) => Promise<void> | void;
        reaction: HermesReaction<any, any>;
    }

    Type Declaration

    • OptionalmaxAttempts?: number

      How many times to run the handler of an event before giving up on it: the event is then written to hermes_dead_letters and skipped, in the transaction that moves the checkpoint of the reaction past it.

      no limit: a failing event is retried until it succeeds, and the events after it in its stream wait
      
    • OptionalonGiveUp?: (
          event: RecordedEvent,
          error: unknown,
          context: ReactionContext<PoolConnection>,
      ) => Promise<void> | void

      Called when the reaction gives up on an event (needs maxAttempts), in the transaction (tx) that writes its dead letter and moves the checkpoint past it. Return to skip the event and handle the next ones, or throw to keep the stream waiting, e.g. until the bug is fixed: nothing is written then, and the event is retried after the retry delay, the handler first.

    • reaction: HermesReaction<any, any>

      The reaction to run; its consumer is named reaction:<name>.