Skip to content

Commit

Permalink
fix on failed emission attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebanasios committed Dec 8, 2024
1 parent 24590b6 commit e8bc112
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ public Mono<Void> initiateCloudInfoRetrieval(String clusterUrl, @Nullable HttpCl
return Mono.fromCallable(() -> UriUtils.setPathForUri(clusterUrl, ""))
.map(url -> cache.computeIfAbsent(url, key -> fetchCloudInfoAsync(url, givenHttpClient)
.retryWhen(new ExponentialRetry<>(exponentialRetryTemplate).retry())
.doOnSuccess(cloudInfo -> sink.emitValue(cloudInfo, Sinks.EmitFailureHandler.FAIL_FAST))

// Since we are trying to achieve concurrent emission to multiple subscribers (Sinks perform emissions serially),
// a handler is specified in order to retry emission attempts for up to the specified duration
.doOnSuccess(cloudInfo -> sink.emitValue(cloudInfo, Sinks.EmitFailureHandler.busyLooping(Duration.ofSeconds(5))))
.onErrorMap(e -> ExceptionUtils.unwrapCloudInfoException(url, e))))
.then();
}
Expand Down

0 comments on commit e8bc112

Please sign in to comment.