public class HystrixModule extends ConfigurableModule<HystrixModule.Config>
To use it one has to register the module.
By default the module registers a HystrixConcurrencyStrategy
with Hystrix that provides a Registry backed strategy for caching HystrixRequestVariable
during a Request. This means that Hystrix will use Ratpack's Request Registry for request caching, request collapsing and request log.
To enable the streaming of Hystrix metrics in text/event-stream format use the sse() configuration option.
For example: (Groovy DSL)
import ratpack.hystrix.HystrixModule
import static ratpack.groovy.Groovy.ratpack
ratpack {
bindings {
add new HystrixModule().sse()
}
}
This allows Server Sent Event based clients such as the Hystrix Dashboard and
Turbine to consume the metrics being reported by your application in realtime. See
HystrixMetricsEventStreamHandler for more details.
| Modifier and Type | Class and Description |
|---|---|
static class |
HystrixModule.Config |
| Constructor and Description |
|---|
HystrixModule() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
HystrixModule |
sse()
Enable the reporting of Hystrix metrics via SSE.
|
configure, createConfig, defaultConfig, setConfigaddError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingprotected void configure()
configure in class AbstractModulepublic HystrixModule sse()
To stream metrics within an application see HystrixMetricsEventStreamHandler.
HystrixModule