Interface KafkaCommitHandler
- All Known Implementing Classes:
KafkaCheckpointCommit,KafkaIgnoreCommit,KafkaLatestCommit,KafkaShareGroupCommit,KafkaThrottledLatestProcessedCommit,OrderedStreamHandler
@Experimental("Experimental API")
public interface KafkaCommitHandler
Kafka commit handling strategy
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory interface forKafkaCommitHandlerstatic interfaceIdentifiers of default strategies -
Method Summary
Modifier and TypeMethodDescriptiondefault <K,V> io.smallrye.mutiny.Multi <IncomingKafkaRecord<K, V>> decorateStream(io.smallrye.mutiny.Multi<IncomingKafkaRecord<K, V>> consumed) Decorates the stream of consumed Kafka records.<K,V> io.smallrye.mutiny.Uni <Void> handle(IncomingKafkaRecord<K, V> record) Handle message acknowledgmentdefault voidpartitionsAssigned(Collection<org.apache.kafka.common.TopicPartition> partitions) Called on partitions assigned on Kafka rebalance listenerdefault voidpartitionsRevoked(Collection<org.apache.kafka.common.TopicPartition> partitions) Called on partitions revokd on Kafka rebalance listenerdefault <K,V> io.smallrye.mutiny.Uni <IncomingKafkaRecord<K, V>> received(IncomingKafkaRecord<K, V> record) Called on message received but before calling the processing function.default voidterminate(boolean graceful) Called on channel shutdown
-
Method Details
-
decorateStream
default <K,V> io.smallrye.mutiny.Multi<IncomingKafkaRecord<K,V>> decorateStream(io.smallrye.mutiny.Multi<IncomingKafkaRecord<K, V>> consumed) Decorates the stream of consumed Kafka records.This method allows commit handlers to transform the incoming stream of records
- Type Parameters:
K- type of record keyV- type of record value- Parameters:
consumed- the stream of consumed Kafka records- Returns:
- the decorated stream of Kafka records
-
received
default <K,V> io.smallrye.mutiny.Uni<IncomingKafkaRecord<K,V>> received(IncomingKafkaRecord<K, V> record) Called on message received but before calling the processing function. ReturnedUniallows chaining asynchronous actions before message processing.- Type Parameters:
K- type of record keyV- type of record value- Parameters:
record- incoming Kafka record- Returns:
- the
Uniyielding the received record
-
terminate
default void terminate(boolean graceful) Called on channel shutdown- Parameters:
graceful-trueif it is a graceful shutdown
-
partitionsAssigned
Called on partitions assigned on Kafka rebalance listener- Parameters:
partitions- assigned partitions
-
partitionsRevoked
Called on partitions revokd on Kafka rebalance listener- Parameters:
partitions- revoked partitions
-
handle
Handle message acknowledgment- Type Parameters:
K- type of record keyV- type of record value- Parameters:
record- incoming Kafka record- Returns:
- a completion stage completed when the message is acknowledged.
-