Class KafkaConnectorCommonConfiguration
java.lang.Object
io.smallrye.reactive.messaging.kafka.KafkaConnectorCommonConfiguration
- Direct Known Subclasses:
KafkaConnectorIncomingConfiguration,KafkaConnectorOutgoingConfiguration
Extracts the common configuration for the
smallrye-kafka connector.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKafkaConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config) Creates a new KafkaConnectorCommonConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.microprofile.config.Configconfig()Gets the bootstrap.servers value from the configuration.Gets the client-id-prefix value from the configuration.Gets the cloud-events value from the configuration.protected <T> Optional<T>getFromAlias(String alias, Class<T> type) Retrieves the value stored for the given alias.protected <T> TgetFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue) Retrieves the value stored for the given alias.Gets the health-enabled value from the configuration.Gets the health-readiness-enabled value from the configuration.Gets the health-readiness-timeout value from the configuration.Gets the health-readiness-topic-verification value from the configuration.Gets the health-topic-verification-enabled value from the configuration.Gets the health-topic-verification-readiness-disabled value from the configuration.Gets the health-topic-verification-startup-disabled value from the configuration.Gets the health-topic-verification-timeout value from the configuration.Gets the kafka-configuration value from the configuration.Gets the lazy-client value from the configuration.getTopic()Gets the topic value from the configuration.Gets the tracing-enabled value from the configuration.voidvalidate()
-
Field Details
-
config
protected final org.eclipse.microprofile.config.Config config
-
-
Constructor Details
-
KafkaConnectorCommonConfiguration
public KafkaConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config) Creates a new KafkaConnectorCommonConfiguration.
-
-
Method Details
-
config
public org.eclipse.microprofile.config.Config config()- Returns:
- the connector configuration
-
getFromAlias
Retrieves the value stored for the given alias.- Type Parameters:
T- the targeted type- Parameters:
alias- the attribute alias, must not benullor blanktype- the targeted type- Returns:
- the configuration value for the given alias, empty if not set
-
getFromAliasWithDefaultValue
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 benullor blanktype- the targeted typedefaultValue- the default value- Returns:
- the configuration value for the given alias, empty if not set
-
getChannel
- Returns:
- the channel name
-
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
Gets the topic value from the configuration. Attribute Name: topic Description: The consumed / populated Kafka topic. If neither this property nor the `topics` properties are set, the channel name is used- Returns:
- the topic
-
getHealthEnabled
Gets the health-enabled value from the configuration. Attribute Name: health-enabled Description: Whether health reporting is enabled (default) or disabled Default Value: true- Returns:
- the health-enabled
-
getHealthReadinessEnabled
Gets the health-readiness-enabled value from the configuration. Attribute Name: health-readiness-enabled Description: Whether readiness health reporting is enabled (default) or disabled Default Value: true- Returns:
- the health-readiness-enabled
-
getHealthReadinessTopicVerification
Gets the health-readiness-topic-verification value from the configuration. Attribute Name: health-readiness-topic-verification Description: Whether the readiness check should verify that topics exist on the broker. Default to false. Enabling it requires an admin connection. Deprecated: Use 'health-topic-verification-enabled' instead.- Returns:
- the health-readiness-topic-verification
-
getHealthReadinessTimeout
Gets the health-readiness-timeout value from the configuration. Attribute Name: health-readiness-timeout Description: During the readiness health check, the connector connects to the broker and retrieves the list of topics. This attribute specifies the maximum duration (in ms) for the retrieval. If exceeded, the channel is considered not-ready. Deprecated: Use 'health-topic-verification-timeout' instead.- Returns:
- the health-readiness-timeout
-
getHealthTopicVerificationEnabled
Gets the health-topic-verification-enabled value from the configuration. Attribute Name: health-topic-verification-enabled Description: Whether the startup and readiness check should verify that topics exist on the broker. Default to false. Enabling it requires an admin client connection. Default Value: false- Returns:
- the health-topic-verification-enabled
-
getHealthTopicVerificationTimeout
Gets the health-topic-verification-timeout value from the configuration. Attribute Name: health-topic-verification-timeout Description: During the startup and readiness health check, the connector connects to the broker and retrieves the list of topics. This attribute specifies the maximum duration (in ms) for the retrieval. If exceeded, the channel is considered not-ready. Default Value: 2000- Returns:
- the health-topic-verification-timeout
-
getHealthTopicVerificationStartupDisabled
Gets the health-topic-verification-startup-disabled value from the configuration. Attribute Name: health-topic-verification-startup-disabled Description: Whether the topic verification is disabled for the startup health check. Default Value: false- Returns:
- the health-topic-verification-startup-disabled
-
getHealthTopicVerificationReadinessDisabled
Gets the health-topic-verification-readiness-disabled value from the configuration. Attribute Name: health-topic-verification-readiness-disabled Description: Whether the topic verification is disabled for the readiness health check. Default Value: false- Returns:
- the health-topic-verification-readiness-disabled
-
getTracingEnabled
Gets the tracing-enabled value from the configuration. Attribute Name: tracing-enabled Description: Whether tracing is enabled (default) or disabled Default Value: true- Returns:
- the tracing-enabled
-
getCloudEvents
Gets the cloud-events value from the configuration. Attribute Name: cloud-events Description: Enables (default) or disables the Cloud Event support. If enabled on an _incoming_ channel, the connector analyzes the incoming records and try to create Cloud Event metadata. If enabled on an _outgoing_, the connector sends the outgoing messages as Cloud Event if the message includes Cloud Event Metadata. Default Value: true- Returns:
- the cloud-events
-
getKafkaConfiguration
Gets the kafka-configuration value from the configuration. Attribute Name: kafka-configuration Description: Identifier of a CDI bean that provides the default Kafka consumer/producer configuration for this channel. The channel configuration can still override any attribute. The bean must have a type of Map<String, Object> and must use the @io.smallrye.common.annotation.Identifier qualifier to set the identifier.- Returns:
- the kafka-configuration
-
getClientIdPrefix
Gets the client-id-prefix value from the configuration. Attribute Name: client-id-prefix Description: Prefix for Kafka client `client.id` attribute. If defined configured or generated `client.id` will be prefixed with the given value.- Returns:
- the client-id-prefix
-
getLazyClient
Gets the lazy-client value from the configuration. Attribute Name: lazy-client Description: Whether Kafka client is created lazily or eagerly. Default Value: false- Returns:
- the lazy-client
-
validate
public void validate()
-