Class KafkaHelper

java.lang.Object
org.eso.ias.kafkautils.KafkaHelper

public class KafkaHelper extends Object
A helper class providing useful methods and constants for Kafka
Author:
acaproni
  • Field Details

    • DEFAULT_BOOTSTRAP_BROKERS

      public static final String DEFAULT_BOOTSTRAP_BROKERS
      Default list of servers
      See Also:
    • BROKERS_PROPNAME

      public static final String BROKERS_PROPNAME
      The name of the property to get the list of kafka servers
      See Also:
    • DEFAULT_CONSUMER_GROUP

      public static final String DEFAULT_CONSUMER_GROUP
      The kafka group to which this consumer belongs
      See Also:
    • CONSUMER_GROUP_PROPNAME

      public static final String CONSUMER_GROUP_PROPNAME
      The name of the property to get the name of the consumer group
      See Also:
    • PLUGINS_TOPIC_NAME

      public static final String PLUGINS_TOPIC_NAME
      The topic used by plugins to send monitor point values and alarms to the converter
      See Also:
    • IASIOs_TOPIC_NAME

      public static final String IASIOs_TOPIC_NAME
      The name of the kafka topic where converters and DASUs push the IASIOs
      See Also:
    • HEARTBEAT_TOPIC_NAME

      public static final String HEARTBEAT_TOPIC_NAME
      The name of the kafka topic where tools publish the heartbeat
      See Also:
    • CMD_TOPIC_NAME

      public static final String CMD_TOPIC_NAME
      The name of the kafka topic for commands
      See Also:
    • REPLY_TOPIC_NAME

      public static final String REPLY_TOPIC_NAME
      The name of the kafka topic for replies
      See Also:
  • Constructor Details

    • KafkaHelper

      public KafkaHelper()
  • Method Details

    • getValue

      public String getValue(String propName, String defaultValue)
      Get the value of a property from the system properties
      Parameters:
      propName - the name of the property whose value must be get from the system properties
      defaultValue - the default value if the property is not defined
      Returns:
      the value of the property
    • getValue

      public String getValue(Properties userProps, String propName, String defaultValue)
      Get the value of a property from the passed properties or, if not found from the System properties. If the value is not found in both properties sets then the default is returned.
      Parameters:
      userProps - the user defined properties
      propName - the name of the property to retrieve
      defaultValue - the default value if the property is not found
      Returns:
      the value of the property