Class HystrixModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- ratpack.guice.ConfigurableModule<HystrixModule.Config>
-
- ratpack.hystrix.HystrixModule
-
- All Implemented Interfaces:
Module
public class HystrixModule extends ConfigurableModule<HystrixModule.Config>
An extension module that provides support for Hystrix.To use it one has to register the module.
By default the module registers a
HystrixConcurrencyStrategy
with Hystrix that provides aRegistry
backed strategy for cachingHystrixRequestVariable
during aRequest
. 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HystrixModule.Config
-
Constructor Summary
Constructors Constructor Description HystrixModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
HystrixModule
sse()
Enable the reporting of Hystrix metrics via SSE.-
Methods inherited from class ratpack.guice.ConfigurableModule
configure, createConfig, defaultConfig, setConfig
-
Methods 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
-
-
-
-
Method Detail
-
configure
protected void configure()
- Specified by:
configure
in classAbstractModule
-
sse
public HystrixModule sse()
Enable the reporting of Hystrix metrics via SSE.To stream metrics within an application see
HystrixMetricsEventStreamHandler
.- Returns:
- this
HystrixModule
-
-