Class MonitoringStreamsInterceptor
- java.lang.Object
-
- io.streamthoughts.azkarra.api.components.BaseComponentModule
-
- io.streamthoughts.azkarra.runtime.interceptors.MonitoringStreamsInterceptor
-
- All Implemented Interfaces:
ComponentFactoryAware
,ConfigurableComponentFactory
,Configurable
,StreamsLifecycleInterceptor
public class MonitoringStreamsInterceptor extends BaseComponentModule implements StreamsLifecycleInterceptor, Configurable
Interceptor to monitorKafkaStreams
instance. Publishes periodically a streams state event to a Kafka topic.
-
-
Constructor Summary
Constructors Constructor Description MonitoringStreamsInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Conf configuration)
Configures this instance with the specifiedConf
.void
onStart(StreamsLifecycleContext context, StreamsLifecycleChain chain)
Intercepts the streams instance before being started.void
onStop(StreamsLifecycleContext context, StreamsLifecycleChain chain)
Intercepts the streams instance before being stopped.MonitoringStreamsInterceptor
withIntervalMs(long intervalMs)
Sets the interval in milliseconds to be used for reporting the state of the monitored Kafka Streams instance.MonitoringStreamsInterceptor
withMonitoringReporter(MonitoringReporter reporter)
Registers aMonitoringReporter
to this interceptor.-
Methods inherited from class io.streamthoughts.azkarra.api.components.BaseComponentModule
getComponentFactory, getConfiguration, setComponentFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.streamthoughts.azkarra.api.components.ConfigurableComponentFactory
getAllComponents, getAllComponents, getAllComponents, getAllComponents, getComponent, getComponent, getComponent, getComponent
-
Methods inherited from interface io.streamthoughts.azkarra.api.StreamsLifecycleInterceptor
name
-
-
-
-
Method Detail
-
configure
public void configure(Conf configuration)
Configures this instance with the specifiedConf
.- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classBaseComponentModule
- Parameters:
configuration
- theConf
instance used to configure this instance.
-
withIntervalMs
public MonitoringStreamsInterceptor withIntervalMs(long intervalMs)
Sets the interval in milliseconds to be used for reporting the state of the monitored Kafka Streams instance.- Parameters:
intervalMs
- the interval in milliseconds.- Returns:
this
.
-
withMonitoringReporter
public MonitoringStreamsInterceptor withMonitoringReporter(MonitoringReporter reporter)
Registers aMonitoringReporter
to this interceptor.- Parameters:
reporter
- the reporter to be registered.- Returns:
this
.
-
onStart
public void onStart(StreamsLifecycleContext context, StreamsLifecycleChain chain)
Intercepts the streams instance before being started.- Specified by:
onStart
in interfaceStreamsLifecycleInterceptor
chain
- theStreamsLifecycleChain
instance.
-
onStop
public void onStop(StreamsLifecycleContext context, StreamsLifecycleChain chain)
Intercepts the streams instance before being stopped.- Specified by:
onStop
in interfaceStreamsLifecycleInterceptor
chain
- theStreamsLifecycleChain
instance.
-
-