Search code examples
javaspring-bootspring-cloudcircuit-breakerresilience4j

what's the diff between resilience4j.circuitbreaker.configs vs resilience4j.circuitbreaker.backends in spring application.properties


From my understanding resilience4j.circuitbreaker.configs.<baseConfigName> defined in application.properties create new CircuitBreakerRegistries with custom default values

and resilience4j.circuitbreaker.instances.<instanceName> create instances of CircuitBreaker referencing the registry defaults to use by resilience4j.circuitbreaker.instances.<myInstance>.base-config: <baseConfigName>

But what are application.properties resilience4j.circuitbreaker.backends.<backendName> for??

If backends are CircuitBreakerConfigs how would these reference to the configs (= CircuitBreakerRegistries) defined?

and how would I use these backends for my CircuitBreaker instances I defined in application.properties ?


Solution

  • backends was the pre instances configuration option and should be now considered deprecated.

    Unfortunately this breaks backward compatibility. The rateLimiter used unfortunately limiters instead of backends. I really don't like the name backends anyway. Maybe we should rename it to instances. For backward compatibility, we could provide both options. What do you think?

    https://github.com/resilience4j/resilience4j/pull/460#discussion_r288423054