Class KafkaLatestCommit
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.commit.ContextHolder
-
- io.smallrye.reactive.messaging.kafka.commit.KafkaLatestCommit
-
- All Implemented Interfaces:
KafkaCommitHandler
public class KafkaLatestCommit extends ContextHolder implements KafkaCommitHandler
Will commit the record offset received by the Kafka consumer (if higher than the previously committed offset). This offset may be greater than the currently ACKed message.This handler is the default when `enable.auto.commit` is `false`. This strategy provides at-least-once delivery if the channel processes the message without performing any asynchronous processing.
This strategy should not be used on high-load as offset commit is expensive.
To use set `commit-strategy` to `latest`.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.smallrye.reactive.messaging.kafka.commit.KafkaCommitHandler
KafkaCommitHandler.Strategy
-
-
Field Summary
-
Fields inherited from class io.smallrye.reactive.messaging.kafka.commit.ContextHolder
context, vertx
-
-
Constructor Summary
Constructors Constructor Description KafkaLatestCommit(io.vertx.mutiny.core.Vertx vertx, KafkaConnectorIncomingConfiguration configuration, io.vertx.mutiny.kafka.client.consumer.KafkaConsumer<?,?> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
CompletionStage<Void>handle(IncomingKafkaRecord<K,V> record)
-
Methods inherited from class io.smallrye.reactive.messaging.kafka.commit.ContextHolder
capture, getContext, runOnContext, runOnContextAndAwait
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.kafka.commit.KafkaCommitHandler
partitionsAssigned, partitionsRevoked, received, terminate
-
-
-
-
Constructor Detail
-
KafkaLatestCommit
public KafkaLatestCommit(io.vertx.mutiny.core.Vertx vertx, KafkaConnectorIncomingConfiguration configuration, io.vertx.mutiny.kafka.client.consumer.KafkaConsumer<?,?> consumer)
-
-
Method Detail
-
handle
public <K,V> CompletionStage<Void> handle(IncomingKafkaRecord<K,V> record)
- Specified by:
handle
in interfaceKafkaCommitHandler
-
-