Skip to content
Advertisement

Where is the parameter in this spring bean comming from

I am new to Spring and need to use the circuit breaker pattern, so I looked at the Spring Cloud Circuit Breaker project and saw this code

JavaScript

where is the factory coming from? is it injected?

The project where this code came from is here demo

cheers,

es

Advertisement

Answer

There is nothing injected.

The methods return a new instance of Customizer<Resilience4JCircuitBreakerFactory>

The code could also be written like this:

JavaScript

But because Customizer is a functional interface it can be written in a lambda.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement