Class Saga.Options.Builder

  • Enclosing class:
    Saga.Options

    public static final class Saga.Options.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setParallelCompensation

        public Saga.Options.Builder setParallelCompensation​(boolean parallelCompensation)
        This decides if the compensation operations are run in parallel. If parallelCompensation is false, then the compensation operations will be run the reverse order as they are added.
        Parameters:
        parallelCompensation -
        Returns:
        option builder
      • setContinueWithError

        public Saga.Options.Builder setContinueWithError​(boolean continueWithError)
        continueWithError gives user the option to bail out of compensation operations if exception is thrown while running them. This is useful only when parallelCompensation is false. If parallel compensation is set to true, then all the compensation operations will be fired no matter what and caller will receive exceptions back if there's any.
        Parameters:
        continueWithError - whether to proceed with the next compensation operation if the previous throws exception. This only applies to sequential compensation.
        Returns:
        option builder