Class KafkaConnectorCommonConfiguration

    • Field Detail

      • config

        protected final org.eclipse.microprofile.config.Config config
    • Constructor Detail

      • KafkaConnectorCommonConfiguration

        public KafkaConnectorCommonConfiguration​(org.eclipse.microprofile.config.Config config)
        Creates a new KafkaConnectorCommonConfiguration.
    • Method Detail

      • config

        public org.eclipse.microprofile.config.Config config()
        Returns:
        the connector configuration
      • getFromAlias

        protected <T> Optional<T> getFromAlias​(String alias,
                                               Class<T> type)
        Retrieves the value stored for the given alias.
        Type Parameters:
        T - the targeted type
        Parameters:
        alias - the attribute alias, must not be null or blank
        type - the targeted type
        Returns:
        the configuration value for the given alias, empty if not set
      • getFromAliasWithDefaultValue

        protected <T> T getFromAliasWithDefaultValue​(String alias,
                                                     Class<T> type,
                                                     T defaultValue)
        Retrieves the value stored for the given alias. Returns the default value if not present.
        Type Parameters:
        T - the targeted type
        Parameters:
        alias - the attribute alias, must not be null or blank
        type - the targeted type
        defaultValue - the default value
        Returns:
        the configuration value for the given alias, empty if not set
      • getChannel

        public String getChannel()
        Returns:
        the channel name
      • getBootstrapServers

        public String getBootstrapServers()
        Gets the bootstrap.servers value from the configuration. Attribute Name: bootstrap.servers Description: A comma-separated list of host:port to use for establishing the initial connection to the Kafka cluster. MicroProfile Config Alias: kafka.bootstrap.servers Default Value: localhost:9092
        Returns:
        the bootstrap.servers
      • getTopic

        public Optional<String> getTopic()
        Gets the topic value from the configuration. Attribute Name: topic Description: The consumed / populated Kafka topic. If not set, the channel name is used
        Returns:
        the topic
      • validate

        public void validate()