Skip to content

Instantly share code, notes, and snippets.

@wenqiglantz
Created February 3, 2022 03:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wenqiglantz/3bfb960f663b8fde98d38371be84d3a6 to your computer and use it in GitHub Desktop.
Save wenqiglantz/3bfb960f663b8fde98d38371be84d3a6 to your computer and use it in GitHub Desktop.
public Mono<String> deleteCustomer(@PathVariable String customerId){
return webClient.delete()
.uri("/customers/" + customerId)
.retrieve()
.bodyToMono(String.class)
.transform(it -> {
ReactiveCircuitBreaker rcb = reactiveCircuitBreakerFactory.create("customer-service");
return rcb.run(it, throwable -> Mono.just(customerId));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment