Annotation Interface Compensation


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface Compensation
Declares a method as compensation for a named saga step.

Compensation is best-effort application logic. The annotation must not be interpreted as automatic rollback of external side effects.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the step name being compensated.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Declares keyed replay support for the compensation's external effect.
  • Element Details

    • step

      String step
      Returns the step name being compensated.
      Returns:
      saga step name
    • idempotent

      boolean idempotent
      Declares keyed replay support for the compensation's external effect.
      Returns:
      whether the original stable compensation key is honored on retry/takeover
      Default:
      false