I want to decorate my service call with the newest resilience4j circuit breaker, my current code looks like:
@Bean
public Function<MyObject1, MyObject2> decoratedFunction(MyService myService) {
CircuitBreakerRegistry registry = CircuitBreakerRegistry.ofDefaults();
CircuitBreaker circuitBreaker = registry.circuitBreaker("circuitBreaker");
//decorateFunction method no longer exists :/
return circuitBreaker.decorateFunction((myObject1) -> myService.makeACall(myObject1))
}
There used to be a method called decorateFunction which I would love to use but for an unknown reason it was removed in the latest version of resilience4j (I'm using latest 1.4 version)
Anyone knows why this function was removed and what is the current replacement for it?
I see there are methods like decorateSupplier but I need to pass a parameter to my service (which is not allowed in case of supplier)