Package org.eso.ias.converter
Class ConverterKafkaStream
java.lang.Object
org.eso.ias.converter.ConverterStream
org.eso.ias.converter.ConverterKafkaStream
The kafka stream used by the converter to get JSON strings
from the plugins and sends JSON strings to the core of the IAS.
The list of kafka servers to connect to and the names of the input and output topics can be passed by means of java properties or programmatically.
- Author:
- acaproni
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default groupid of the Kafka consumerstatic final String
The name of the java property to get the name of the topic where plugins push valuesstatic final String
The name of the property to customize the group id of the consumerstatic final String
The name of the property to pass the kafka servers to connect toFields inherited from class org.eso.ias.converter.ConverterStream
converterID, mapper
-
Constructor Summary
ConstructorDescriptionConverterKafkaStream
(String converterID, String servers, String pluginTopicName, String iasCoreTopicName) ConstructorConverterKafkaStream
(String converterID, Optional<String> kafkaBrokers, Properties props) The constructor takes the names of the topics for the streaming from the passed properties or falls back to the defaults. -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
Initialize the streamprotected void
Start streaming data from the kafka input topic to the kafka output topicprotected void
Stop streaming dataMethods inherited from class org.eso.ias.converter.ConverterStream
initialize, start, stop
-
Field Details
-
IASCORE_TOPIC_NAME_PROP_NAME
The name of the java property to get the name of the topic where plugins push values- See Also:
-
KAFKA_SERVERS_PROP_NAME
The name of the property to pass the kafka servers to connect to- See Also:
-
KAFKA_CONSUMER_GROUP_ID_PROP_NAME
The name of the property to customize the group id of the consumer- See Also:
-
DEFAULT_CONSUMER_GROUPID
The default groupid of the Kafka consumer- See Also:
-
-
Constructor Details
-
ConverterKafkaStream
The constructor takes the names of the topics for the streaming from the passed properties or falls back to the defaults. The constructor takes the string to connect to kafka brokers from the parameters of from the passed properties. The property overrides the value passed inkafkaBrokers
. If the parameter is empty and no property is defined, it falls to default kafka broker URL defined inKafkaHelper.DEFAULT_BOOTSTRAP_BROKERS
.- Parameters:
converterID
- The ID of the converterkafkaBrokers
- The URL to connect to kafka broker(s) read from the CDBprops
- the properties to get kafka serves and topic anmes
-
ConverterKafkaStream
public ConverterKafkaStream(String converterID, String servers, String pluginTopicName, String iasCoreTopicName) Constructor- Parameters:
converterID
- The ID of the converterservers
- The kafka servers to connect topluginTopicName
- The name of the topic to get monitor points from pluginsiasCoreTopicName
- The name of the topic to send values to the core of the IAS
-
-
Method Details
-
init
public void init()Initialize the stream- Specified by:
init
in classConverterStream
-
startStreaming
Start streaming data from the kafka input topic to the kafka output topic- Specified by:
startStreaming
in classConverterStream
- Throws:
ConverterStreamException
- in case of error starting- See Also:
-
stopStreaming
Stop streaming data- Specified by:
stopStreaming
in classConverterStream
- Throws:
ConverterStreamException
- in case of error stopping- See Also:
-