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
HystrixConcurrencyStrategywith Hystrix that provides aRegistrybacked strategy for cachingHystrixRequestVariableduring 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
HystrixMetricsEventStreamHandlerfor more details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHystrixModule.Config
-
Constructor Summary
Constructors Constructor Description HystrixModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure()HystrixModulesse()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()
- Overrides:
configurein classAbstractModule
-
sse
public HystrixModule sse()
Enable the reporting of Hystrix metrics via SSE.To stream metrics within an application see
HystrixMetricsEventStreamHandler.- Returns:
- this
HystrixModule
-
-