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

Extensions for io.vertx.kafka.client.consumer.KafkaConsumer

assignAwait

suspend fun <K, V> KafkaConsumer<K, V>.assignAwait(topicPartition: TopicPartition): Unit

Manually assign a partition to this consumer.

suspend fun <K, V> KafkaConsumer<K, V>.assignAwait(topicPartitions: Set<TopicPartition>): Unit

Manually assign a list of partition to this consumer.

assignmentAwait

suspend fun <K, V> KafkaConsumer<K, V>.assignmentAwait(): Set<TopicPartition>

Get the set of partitions currently assigned to this consumer.

beginningOffsetsAwait

suspend fun <K, V> KafkaConsumer<K, V>.beginningOffsetsAwait(topicPartition: TopicPartition): Long

Get the first offset for the given partitions.

closeAwait

suspend fun <K, V> KafkaConsumer<K, V>.closeAwait(): Unit

Close the consumer

commitAwait

suspend fun <K, V> KafkaConsumer<K, V>.commitAwait(): Unit

Commit current offsets for all the subscribed list of topics and partition.

committedAwait

suspend fun <K, V> KafkaConsumer<K, V>.committedAwait(topicPartition: TopicPartition): OffsetAndMetadata

Get the last committed offset for the given partition (whether the commit happened by this process or another).

endOffsetsAwait

suspend fun <K, V> KafkaConsumer<K, V>.endOffsetsAwait(topicPartition: TopicPartition): Long

Get the last offset for the given partition. The last offset of a partition is the offset of the upcoming message, i.e. the offset of the last available message + 1.

offsetsForTimesAwait

suspend fun <K, V> KafkaConsumer<K, V>.offsetsForTimesAwait(topicPartition: TopicPartition, timestamp: Long): OffsetAndTimestamp

Look up the offset for the given partition by timestamp. Note: the result might be null in case for the given timestamp no offset can be found -- e.g., when the timestamp refers to the future

partitionsForAwait

suspend fun <K, V> KafkaConsumer<K, V>.partitionsForAwait(topic: String): List<PartitionInfo>

Get metadata about the partitions for a given topic.

pauseAwait

suspend fun <K, V> KafkaConsumer<K, V>.pauseAwait(topicPartition: TopicPartition): Unit

Suspend fetching from the requested partition.

suspend fun <K, V> KafkaConsumer<K, V>.pauseAwait(topicPartitions: Set<TopicPartition>): Unit

Suspend fetching from the requested partitions.

pausedAwait

suspend fun <K, V> KafkaConsumer<K, V>.pausedAwait(): Set<TopicPartition>

Get the set of partitions that were previously paused by a call to pause(Set).

pollAwait

suspend fun <K, V> KafkaConsumer<K, V>.pollAwait(timeout: Long): KafkaConsumerRecords<K, V>

Executes a poll for getting messages from Kafka

positionAwait

suspend fun <K, V> KafkaConsumer<K, V>.positionAwait(partition: TopicPartition): Long

Get the offset of the next record that will be fetched (if a record with that offset exists).

resumeAwait

suspend fun <K, V> KafkaConsumer<K, V>.resumeAwait(topicPartition: TopicPartition): Unit

Resume specified partition which have been paused with pause.

suspend fun <K, V> KafkaConsumer<K, V>.resumeAwait(topicPartitions: Set<TopicPartition>): Unit

Resume specified partitions which have been paused with pause.

seekAwait

suspend fun <K, V> KafkaConsumer<K, V>.seekAwait(topicPartition: TopicPartition, offset: Long): Unit

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

seekToBeginningAwait

suspend fun <K, V> KafkaConsumer<K, V>.seekToBeginningAwait(topicPartition: TopicPartition): Unit

Seek to the first offset for each of the given partition.

suspend fun <K, V> KafkaConsumer<K, V>.seekToBeginningAwait(topicPartitions: Set<TopicPartition>): Unit

Seek to the first offset for each of the given partitions.

seekToEndAwait

suspend fun <K, V> KafkaConsumer<K, V>.seekToEndAwait(topicPartition: TopicPartition): Unit

Seek to the last offset for each of the given partition.

suspend fun <K, V> KafkaConsumer<K, V>.seekToEndAwait(topicPartitions: Set<TopicPartition>): Unit

Seek to the last offset for each of the given partitions.

subscribeAwait

suspend fun <K, V> KafkaConsumer<K, V>.subscribeAwait(topic: String): Unit

Subscribe to the given topic to get dynamically assigned partitions.

suspend fun <K, V> KafkaConsumer<K, V>.subscribeAwait(topics: Set<String>): Unit

Subscribe to the given list of topics to get dynamically assigned partitions.

subscriptionAwait

suspend fun <K, V> KafkaConsumer<K, V>.subscriptionAwait(): Set<String>

Get the current subscription.

unsubscribeAwait

suspend fun <K, V> KafkaConsumer<K, V>.unsubscribeAwait(): Unit

Unsubscribe from topics currently subscribed with subscribe.