Class MonitoringStreamsInterceptorConfig
- java.lang.Object
-
- io.streamthoughts.azkarra.runtime.interceptors.MonitoringStreamsInterceptorConfig
-
public class MonitoringStreamsInterceptorConfig extends Object
The configuration class forMonitoringStreamsInterceptor
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
monitoring.streams.interceptor.advertised.server
static String
MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
monitoring.streams.interceptor.ce.extensions
static String
MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
monitoring.streams.interceptor.interval.ms
static long
MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
static String
MONITORING_INTERCEPTOR_PRODUCER_PREFIX
Prefix used to isolateproducer
configs from other client configs.static String
MONITORING_INTERCEPTOR_TOPIC_CONFIG
monitoring.streams.interceptor.topic
static String
MONITORING_INTERCEPTOR_TOPIC_DEFAULT
static String
MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
monitoring.streams.interceptor.enable
-
Constructor Summary
Constructors Constructor Description MonitoringStreamsInterceptorConfig(Conf originals)
Creates a newMonitoringStreamsInterceptorConfig
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
getAdvertisedServer()
Get the server name that will be included in monitoring events.CloudEventsExtension
getExtensions()
Get the list of extension attributes that should be included in monitoring events.long
getIntervalMs()
Get the period the interceptor should use to send a streams state event (Default is 10 seconds).Map<String,Object>
getProducerConfigs(String clientId)
Get the configs for theproducer
.String
getTopic()
Get the topic on which monitoring event will be sent (Default is _azkarra-streams-monitoring).static String
producerPrefix(String producerProp)
Prefix a property withMONITORING_INTERCEPTOR_PRODUCER_PREFIX
.
-
-
-
Field Detail
-
MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
public static String MONITORING_STREAMS_INTERCEPTOR_ENABLE_CONFIG
monitoring.streams.interceptor.enable
-
MONITORING_INTERCEPTOR_PRODUCER_PREFIX
public static final String MONITORING_INTERCEPTOR_PRODUCER_PREFIX
Prefix used to isolateproducer
configs from other client configs. It is recommended to useproducerPrefix(String)
to add this prefix toproducer properties
.- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
public static final String MONITORING_INTERCEPTOR_INTERVAL_MS_CONFIG
monitoring.streams.interceptor.interval.ms
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
public static final long MONITORING_INTERCEPTOR_INTERVAL_MS_DEFAULT
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_TOPIC_CONFIG
public static final String MONITORING_INTERCEPTOR_TOPIC_CONFIG
monitoring.streams.interceptor.topic
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_TOPIC_DEFAULT
public static final String MONITORING_INTERCEPTOR_TOPIC_DEFAULT
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
public static final String MONITORING_INTERCEPTOR_ADVERTISED_SERVER_CONFIG
monitoring.streams.interceptor.advertised.server
- See Also:
- Constant Field Values
-
MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
public static final String MONITORING_INTERCEPTOR_EXTENSIONS_CONFIG
monitoring.streams.interceptor.ce.extensions
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MonitoringStreamsInterceptorConfig
public MonitoringStreamsInterceptorConfig(Conf originals)
Creates a newMonitoringStreamsInterceptorConfig
instance.- Parameters:
originals
- theConf
instance.
-
-
Method Detail
-
producerPrefix
public static String producerPrefix(String producerProp)
Prefix a property withMONITORING_INTERCEPTOR_PRODUCER_PREFIX
. This is used to isolateproducer configs
.- Parameters:
producerProp
- the producer property to be masked- Returns:
- WATCHER_PRODUCER_PREFIX +
producerProp
-
getIntervalMs
public long getIntervalMs()
Get the period the interceptor should use to send a streams state event (Default is 10 seconds).- Returns:
- the period in milliseconds.
-
getAdvertisedServer
public Optional<String> getAdvertisedServer()
Get the server name that will be included in monitoring events. If not specified, the streamsapplication.server
property is used."- Returns:
- an optional advertised server name.
-
getTopic
public String getTopic()
Get the topic on which monitoring event will be sent (Default is _azkarra-streams-monitoring).- Returns:
- the name of the topic.
-
getExtensions
public CloudEventsExtension getExtensions()
Get the list of extension attributes that should be included in monitoring events.- Returns:
- the
CloudEventsExtension
.
-
getProducerConfigs
public Map<String,Object> getProducerConfigs(String clientId)
Get the configs for theproducer
. Properties using the prefixMONITORING_INTERCEPTOR_PRODUCER_PREFIX
will be used in favor over their non-prefixed versions .- Parameters:
clientId
- clientId- Returns:
- Map of the producer configuration.
-
-