Class KafkaConnectorIncomingConfiguration
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.KafkaConnectorCommonConfiguration
-
- io.smallrye.reactive.messaging.kafka.KafkaConnectorIncomingConfiguration
-
public class KafkaConnectorIncomingConfiguration extends KafkaConnectorCommonConfiguration
Extract the incoming configuration for thesmallrye-kafka
connector.
-
-
Field Summary
-
Fields inherited from class io.smallrye.reactive.messaging.kafka.KafkaConnectorCommonConfiguration
config
-
-
Constructor Summary
Constructors Constructor Description KafkaConnectorIncomingConfiguration(org.eclipse.microprofile.config.Config config)
Creates a new KafkaConnectorIncomingConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAutoOffsetReset()
Gets the auto.offset.reset value from the configuration.Boolean
getBroadcast()
Gets the broadcast value from the configuration.Boolean
getCloudEvents()
Gets the cloud-events value from the configuration.Optional<String>
getCommitStrategy()
Gets the commit-strategy value from the configuration.Optional<String>
getConsumerRebalanceListenerName()
Gets the consumer-rebalance-listener.name value from the configuration.Optional<String>
getDeadLetterQueueKeySerializer()
Gets the dead-letter-queue.key.serializer value from the configuration.Optional<String>
getDeadLetterQueueTopic()
Gets the dead-letter-queue.topic value from the configuration.Optional<String>
getDeadLetterQueueValueSerializer()
Gets the dead-letter-queue.value.serializer value from the configuration.Boolean
getEnableAutoCommit()
Gets the enable.auto.commit value from the configuration.String
getFailureStrategy()
Gets the failure-strategy value from the configuration.Integer
getFetchMinBytes()
Gets the fetch.min.bytes value from the configuration.Optional<String>
getGroupId()
Gets the group.id value from the configuration.Optional<String>
getKeyDeserializationFailureHandler()
Gets the key-deserialization-failure-handler value from the configuration.String
getKeyDeserializer()
Gets the key.deserializer value from the configuration.Integer
getPartitions()
Gets the partitions value from the configuration.Boolean
getPattern()
Gets the pattern value from the configuration.Boolean
getRetry()
Gets the retry value from the configuration.Integer
getRetryAttempts()
Gets the retry-attempts value from the configuration.Integer
getRetryMaxWait()
Gets the retry-max-wait value from the configuration.Integer
getThrottledUnprocessedRecordMaxAgeMs()
Gets the throttled.unprocessed-record-max-age.ms value from the configuration.Optional<String>
getTopics()
Gets the topics value from the configuration.Optional<String>
getValueDeserializationFailureHandler()
Gets the value-deserialization-failure-handler value from the configuration.String
getValueDeserializer()
Gets the value.deserializer value from the configuration.void
validate()
-
Methods inherited from class io.smallrye.reactive.messaging.kafka.KafkaConnectorCommonConfiguration
config, getBootstrapServers, getChannel, getFromAlias, getFromAliasWithDefaultValue, getHealthEnabled, getHealthReadinessEnabled, getHealthReadinessTimeout, getTopic, getTracingEnabled
-
-
-
-
Method Detail
-
getTopics
public Optional<String> getTopics()
Gets the topics value from the configuration. Attribute Name: topics Description: A comma-separating list of topics to be consumed. Cannot be used with the `topic` or `pattern` properties- Returns:
- the topics
-
getPattern
public Boolean getPattern()
Gets the pattern value from the configuration. Attribute Name: pattern Description: Indicate that the `topic` property is a regular expression. Must be used with the `topic` property. Cannot be used with the `topics` property Default Value: false- Returns:
- the pattern
-
getKeyDeserializer
public String getKeyDeserializer()
Gets the key.deserializer value from the configuration. Attribute Name: key.deserializer Description: The deserializer classname used to deserialize the record's key Default Value: org.apache.kafka.common.serialization.StringDeserializer- Returns:
- the key.deserializer
-
getValueDeserializer
public String getValueDeserializer()
Gets the value.deserializer value from the configuration. Attribute Name: value.deserializer Description: The deserializer classname used to deserialize the record's value Mandatory: yes- Returns:
- the value.deserializer
-
getFetchMinBytes
public Integer getFetchMinBytes()
Gets the fetch.min.bytes value from the configuration. Attribute Name: fetch.min.bytes Description: The minimum amount of data the server should return for a fetch request. The default setting of 1 byte means that fetch requests are answered as soon as a single byte of data is available or the fetch request times out waiting for data to arrive. Default Value: 1- Returns:
- the fetch.min.bytes
-
getGroupId
public Optional<String> getGroupId()
Gets the group.id value from the configuration. Attribute Name: group.id Description: A unique string that identifies the consumer group the application belongs to. If not set, a unique, generated id is used- Returns:
- the group.id
-
getEnableAutoCommit
public Boolean getEnableAutoCommit()
Gets the enable.auto.commit value from the configuration. Attribute Name: enable.auto.commit Description: If enabled, consumer's offset will be periodically committed in the background by the underlying Kafka client, ignoring the actual processing outcome of the records. It is recommended to NOT enable this setting and let Reactive Messaging handles the commit. Default Value: false- Returns:
- the enable.auto.commit
-
getRetry
public Boolean getRetry()
Gets the retry value from the configuration. Attribute Name: retry Description: Whether or not the connection to the broker is re-attempted in case of failure Default Value: true- Returns:
- the retry
-
getRetryAttempts
public Integer getRetryAttempts()
Gets the retry-attempts value from the configuration. Attribute Name: retry-attempts Description: The maximum number of reconnection before failing. -1 means infinite retry Default Value: -1- Returns:
- the retry-attempts
-
getRetryMaxWait
public Integer getRetryMaxWait()
Gets the retry-max-wait value from the configuration. Attribute Name: retry-max-wait Description: The max delay (in seconds) between 2 reconnects Default Value: 30- Returns:
- the retry-max-wait
-
getBroadcast
public Boolean getBroadcast()
Gets the broadcast value from the configuration. Attribute Name: broadcast Description: Whether the Kafka records should be dispatched to multiple consumer Default Value: false- Returns:
- the broadcast
-
getAutoOffsetReset
public String getAutoOffsetReset()
Gets the auto.offset.reset value from the configuration. Attribute Name: auto.offset.reset Description: What to do when there is no initial offset in Kafka.Accepted values are earliest, latest and none Default Value: latest- Returns:
- the auto.offset.reset
-
getFailureStrategy
public String getFailureStrategy()
Gets the failure-strategy value from the configuration. Attribute Name: failure-strategy Description: Specify the failure strategy to apply when a message produced from a record is acknowledged negatively (nack). Values can be `fail` (default), `ignore`, or `dead-letter-queue` Default Value: fail- Returns:
- the failure-strategy
-
getCommitStrategy
public Optional<String> getCommitStrategy()
Gets the commit-strategy value from the configuration. Attribute Name: commit-strategy Description: Specify the commit strategy to apply when a message produced from a record is acknowledged. Values can be `latest`, `ignore` or `throttled`. If `enable.auto.commit` is true then the default is `ignore` otherwise it is `throttled`- Returns:
- the commit-strategy
-
getThrottledUnprocessedRecordMaxAgeMs
public Integer getThrottledUnprocessedRecordMaxAgeMs()
Gets the throttled.unprocessed-record-max-age.ms value from the configuration. Attribute Name: throttled.unprocessed-record-max-age.ms Description: While using the `throttled` commit-strategy, specify the max age in milliseconds that an unprocessed message can be before the connector is marked as unhealthy. Default Value: 60000- Returns:
- the throttled.unprocessed-record-max-age.ms
-
getDeadLetterQueueTopic
public Optional<String> getDeadLetterQueueTopic()
Gets the dead-letter-queue.topic value from the configuration. Attribute Name: dead-letter-queue.topic Description: When the `failure-strategy` is set to `dead-letter-queue` indicates on which topic the record is sent. Defaults is `dead-letter-topic-$channel`- Returns:
- the dead-letter-queue.topic
-
getDeadLetterQueueKeySerializer
public Optional<String> getDeadLetterQueueKeySerializer()
Gets the dead-letter-queue.key.serializer value from the configuration. Attribute Name: dead-letter-queue.key.serializer Description: When the `failure-strategy` is set to `dead-letter-queue` indicates the key serializer to use. If not set the serializer associated to the key deserializer is used- Returns:
- the dead-letter-queue.key.serializer
-
getDeadLetterQueueValueSerializer
public Optional<String> getDeadLetterQueueValueSerializer()
Gets the dead-letter-queue.value.serializer value from the configuration. Attribute Name: dead-letter-queue.value.serializer Description: When the `failure-strategy` is set to `dead-letter-queue` indicates the value serializer to use. If not set the serializer associated to the value deserializer is used- Returns:
- the dead-letter-queue.value.serializer
-
getPartitions
public Integer getPartitions()
Gets the partitions value from the configuration. Attribute Name: partitions Description: The number of partitions to be consumed concurrently. The connector creates the specified amount of Kafka consumers. It should match the number of partition of the targeted topic Default Value: 1- Returns:
- the partitions
-
getCloudEvents
public Boolean getCloudEvents()
Gets the cloud-events value from the configuration. Attribute Name: cloud-events Description: Enables (default) or disables the Cloud Event support. If enabled, the connector analyzes the incoming records and try to create Cloud Event metadata. Default Value: true- Returns:
- the cloud-events
-
getConsumerRebalanceListenerName
public Optional<String> getConsumerRebalanceListenerName()
Gets the consumer-rebalance-listener.name value from the configuration. Attribute Name: consumer-rebalance-listener.name Description: The name set in `javax.inject.Named` of a bean that implements `io.smallrye.reactive.messaging.kafka.KafkaConsumerRebalanceListener`. If set, this rebalance listener is applied to the consumer.- Returns:
- the consumer-rebalance-listener.name
-
getKeyDeserializationFailureHandler
public Optional<String> getKeyDeserializationFailureHandler()
Gets the key-deserialization-failure-handler value from the configuration. Attribute Name: key-deserialization-failure-handler Description: The name set in `javax.inject.Named` of a bean that implements `io.smallrye.reactive.messaging.kafka.DeserializationFailureHandler`. If set, deserialization failure happening when deserializing keys are delegated to this handler which may provide a fallback value.- Returns:
- the key-deserialization-failure-handler
-
getValueDeserializationFailureHandler
public Optional<String> getValueDeserializationFailureHandler()
Gets the value-deserialization-failure-handler value from the configuration. Attribute Name: value-deserialization-failure-handler Description: The name set in `javax.inject.Named` of a bean that implements `io.smallrye.reactive.messaging.kafka.DeserializationFailureHandler`. If set, deserialization failure happening when deserializing values are delegated to this handler which may provide a fallback value.- Returns:
- the value-deserialization-failure-handler
-
validate
public void validate()
- Overrides:
validate
in classKafkaConnectorCommonConfiguration
-
-