vertx / io.vertx.kafka.client.consumer / KafkaConsumer / seek

seek

abstract fun seek(topicPartition: TopicPartition, offset: Long): KafkaConsumer<K, V>

Overrides the fetch offsets that the consumer will use on the next poll.

Parameters

topicPartition - topic partition for which seek

offset - offset to seek inside the topic partition

Return
current KafkaConsumer instance

abstract fun seek(topicPartition: TopicPartition, offset: Long, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>

Overrides the fetch offsets that the consumer will use on the next poll.

Due to internal buffering of messages, the record handler will continue to observe messages fetched with respect to the old offset until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will only see messages consistent with the new offset.

Parameters

topicPartition - topic partition for which seek

offset - offset to seek inside the topic partition

completionHandler - handler called on operation completed

Return
current KafkaConsumer instance