Interface Fallback<T>

  • Type Parameters:
    T - type of the values returned
    All Superinterfaces:

    public interface Fallback<T>
    extends FtHandlerTyped<T>
    Fallback allows the user to execute an alternative function in case the provided supplier fails.

    In case you call the FtHandlerTyped.invokeMulti(java.util.function.Supplier) method, the following restriction applies:

    • In case at least one record was sent (one onNext was called), the fallback will not trigger.
    You may provide fallback for both a Multi and a Single. If none is provided, the method is executed without fallback.
    • Method Detail

      • builder

        static <T> Fallback.Builder<T> builder()
        A builder to customize Fallback.
        Type Parameters:
        T - type of the values returned by the failing method
        a new builder
      • createMulti

        static <T> Fallback<T> createMulti​(Function<Throwable,​? extends Flow.Publisher<T>> fallback)
        Create a fallback for a Multi or Flow.Publisher.
        Type Parameters:
        T - type of the result
        fallback - fallback supplier to obtain the alternative result
        a new fallback