Class ProviderUtil
java.lang.Object
com.broadleafcommerce.datafeed.service.collector.provider.support.ProviderUtil
Convenient helper for common functionality with providers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> reactor.core.publisher.Mono<T>
applyTimeoutAndRetryIfApplicable
(reactor.core.publisher.Mono<T> mono, ProviderProperties properties, Consumer<reactor.util.retry.Retry.RetrySignal> doBeforeRetry) AppliesMono.timeout(Duration)
andMono.retryWhen(Retry)
if applicable.
-
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) AppliesMono.timeout(Duration)
andMono.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 timeoutproperties
- provider properties from which to source timeout and retry configurationdoBeforeRetry
- (optional) a function to supply toRetryBackoffSpec.doBeforeRetry(Consumer)
- Returns:
- the mono after applying the configuration if applicable, else the input mono
-