java.lang.Object
com.broadleafcommerce.datafeed.service.collector.provider.support.ProviderUtil

public class ProviderUtil extends Object
Convenient helper for common functionality with providers.
  • Constructor Details

    • ProviderUtil

      public ProviderUtil()
  • Method Details

    • applyTimeoutAndRetryIfApplicable

      public <T> reactor.core.publisher.Mono<T> applyTimeoutAndRetryIfApplicable(reactor.core.publisher.Mono<T> mono, ProviderProperties properties, @Nullable Consumer<reactor.util.retry.Retry.RetrySignal> doBeforeRetry)
      Applies Mono.timeout(Duration) and Mono.retryWhen(Retry) if applicable. Otherwise, returns the given mono.
      Type Parameters:
      T - the type of the value in the mono
      Parameters:
      mono - the mono on which to apply a timeout
      properties - provider properties from which to source timeout and retry configuration
      doBeforeRetry - (optional) a function to supply to RetryBackoffSpec.doBeforeRetry(Consumer)
      Returns:
      the mono after applying the configuration if applicable, else the input mono