Class Resilience4jModule
- All Implemented Interfaces:
com.google.inject.Module
public class Resilience4jModule extends ratpack.guice.ConfigurableModule<Resilience4jConfig>
This module also registers metrics: - bulkhead, circuitbreaker, ratelimiter, and retry metrics with dropwizard metrics, if enabled. - circuitbreaker, ratelimiter, and retry metrics with prometheus, if enabled.
Only enable metrics if you have dependencies for resilience4j-metrics in the classpath and an
instance of MetricRegistry is bound (usually this will happen when installing DropwizardMetricsModule). This must be done manually, since guice doesn't know if dropwizard is
on the runtime classpath.
Only enable prometheus if you have a dependency on resilience4j-prometheus in the classpath and
an instance of CollectorRegistry is bound. This must be done manually, since guice
doesn't know if prometheus is on the runtime classpath.
Also note that for this to work, CircuitBreaker, RateLimiter, and Retry instances must be created before the respective registries are bound.
-
Constructor Summary
Constructors Constructor Description Resilience4jModule() -
Method Summary
Modifier and Type Method Description protected voidconfigure()Methods inherited from class ratpack.guice.ConfigurableModule
configure, createConfig, defaultConfig, setConfigMethods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Constructor Details
-
Resilience4jModule
public Resilience4jModule()
-
-
Method Details
-
configure
protected void configure()- Specified by:
configurein classcom.google.inject.AbstractModule
-