Interface KafkaCommitHandler
-
- All Known Implementing Classes:
KafkaCheckpointCommit
,KafkaIgnoreCommit
,KafkaLatestCommit
,KafkaThrottledLatestProcessedCommit
@Experimental("Experimental API") public interface KafkaCommitHandler
Kafka commit handling strategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
KafkaCommitHandler.Factory
Factory interface forKafkaCommitHandler
static interface
KafkaCommitHandler.Strategy
Identifiers of default strategies
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <K,V>
io.smallrye.mutiny.Uni<Void>handle(IncomingKafkaRecord<K,V> record)
Handle message acknowledgmentdefault void
partitionsAssigned(Collection<org.apache.kafka.common.TopicPartition> partitions)
Called on partitions assigned on Kafka rebalance listenerdefault void
partitionsRevoked(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 void
terminate(boolean graceful)
Called on channel shutdown
-
-
-
Method Detail
-
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. ReturnedUni
allows chaining asynchronous actions before message processing.- Type Parameters:
K
- type of record keyV
- type of record value- Parameters:
record
- incoming Kafka record- Returns:
- the
Uni
yielding the received record
-
terminate
default void terminate(boolean graceful)
Called on channel shutdown- Parameters:
graceful
-true
if it is a graceful shutdown
-
partitionsAssigned
default void partitionsAssigned(Collection<org.apache.kafka.common.TopicPartition> partitions)
Called on partitions assigned on Kafka rebalance listener- Parameters:
partitions
- assigned partitions
-
partitionsRevoked
default void partitionsRevoked(Collection<org.apache.kafka.common.TopicPartition> partitions)
Called on partitions revokd on Kafka rebalance listener- Parameters:
partitions
- revoked partitions
-
handle
<K,V> io.smallrye.mutiny.Uni<Void> handle(IncomingKafkaRecord<K,V> record)
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.
-
-