open class KafkaConsumer<K : Any, V : Any> : ReadStream<KafkaConsumerRecord<K, V>>
Vert.x Kafka consumer.
You receive Kafka records by providing a io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#handler. As messages arrive the handler will be called with the records.
The io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause and io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume provides global control over reading the records from the consumer.
The io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause and io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume provides finer grained control over reading records for specific Topic/Partition, these are Kafka's specific operations.
KafkaConsumer(delegate: KafkaConsumer<Any, Any>)KafkaConsumer(delegate: KafkaConsumer<Any, Any>, typeArg_0: TypeArg<K>, typeArg_1: TypeArg<V>) |
static val __TYPE_ARG: TypeArg<KafkaConsumer<Any, Any>> |
|
val __typeArg_0: TypeArg<K> |
|
val __typeArg_1: TypeArg<V> |
open fun assign(topicPartition: TopicPartition): KafkaConsumer<K, V>open fun assign(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Manually assign a partition to this consumer. open fun assign(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>open fun assign(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Manually assign a list of partition to this consumer. |
|
open fun assignment(handler: Handler<AsyncResult<MutableSet<TopicPartition>>>): KafkaConsumer<K, V>
Get the set of partitions currently assigned to this consumer. |
|
open fun batchHandler(handler: Handler<KafkaConsumerRecords<K, V>>): KafkaConsumer<K, V>
Set the handler to be used when batches of messages are fetched from the Kafka server. Batch handlers need to take care not to block the event loop when dealing with large batches. It is better to process records individually using the io.vertx.reactivex.kafka.client.consumer.KafkaConsumer. |
|
open fun beginningOffsets(topicPartition: TopicPartition, handler: Handler<AsyncResult<Long>>): Unit
Get the first offset for the given partitions. |
|
open fun close(): Unitopen fun close(completionHandler: Handler<AsyncResult<Void>>): Unit
Close the consumer |
|
open fun commit(): Unitopen fun commit(completionHandler: Handler<AsyncResult<Void>>): Unit
Commit current offsets for all the subscribed list of topics and partition. |
|
open fun committed(topicPartition: TopicPartition, handler: Handler<AsyncResult<OffsetAndMetadata>>): Unit
Get the last committed offset for the given partition (whether the commit happened by this process or another). |
|
open static fun <K : Any, V : Any> create(vertx: Vertx, config: MutableMap<String, String>): KafkaConsumer<K, V>open static fun <K : Any, V : Any> create(vertx: Vertx, config: MutableMap<String, String>, keyType: Class<K>, valueType: Class<V>): KafkaConsumer<K, V>
Create a new KafkaConsumer instance |
|
open fun endHandler(endHandler: Handler<Void>): KafkaConsumer<K, V> |
|
open fun endOffsets(topicPartition: TopicPartition, handler: Handler<AsyncResult<Long>>): Unit
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. |
|
open fun equals(other: Any?): Boolean |
|
open fun exceptionHandler(handler: Handler<Throwable>): KafkaConsumer<K, V> |
|
open fun getDelegate(): KafkaConsumer<Any, Any> |
|
open fun handler(handler: Handler<KafkaConsumerRecord<K, V>>): KafkaConsumer<K, V> |
|
open fun hashCode(): Int |
|
open static fun <K : Any, V : Any> newInstance(arg: KafkaConsumer<Any, Any>): KafkaConsumer<K, V>open static fun <K : Any, V : Any> newInstance(arg: KafkaConsumer<Any, Any>, __typeArg_K: TypeArg<K>, __typeArg_V: TypeArg<V>): KafkaConsumer<K, V> |
|
open fun offsetsForTimes(topicPartition: TopicPartition, timestamp: Long, handler: Handler<AsyncResult<OffsetAndTimestamp>>): Unit
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 |
|
open fun partitionsAssignedHandler(handler: Handler<MutableSet<TopicPartition>>): KafkaConsumer<K, V>
Set the handler called when topic partitions are assigned to the consumer |
|
open fun partitionsFor(topic: String, handler: Handler<AsyncResult<MutableList<PartitionInfo>>>): KafkaConsumer<K, V>
Get metadata about the partitions for a given topic. |
|
open fun partitionsRevokedHandler(handler: Handler<MutableSet<TopicPartition>>): KafkaConsumer<K, V>
Set the handler called when topic partitions are revoked to the consumer |
|
open fun pause(): KafkaConsumer<K, V>open fun pause(topicPartition: TopicPartition): KafkaConsumer<K, V>open fun pause(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Suspend fetching from the requested partition. open fun pause(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>open fun pause(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Suspend fetching from the requested partitions. |
|
open fun paused(handler: Handler<AsyncResult<MutableSet<TopicPartition>>>): Unit
Get the set of partitions that were previously paused by a call to pause(Set). |
|
open fun position(partition: TopicPartition, handler: Handler<AsyncResult<Long>>): Unit
Get the offset of the next record that will be fetched (if a record with that offset exists). |
|
open fun resume(): KafkaConsumer<K, V>open fun resume(topicPartition: TopicPartition): KafkaConsumer<K, V>open fun resume(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Resume specified partition which have been paused with pause. open fun resume(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>open fun resume(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Resume specified partitions which have been paused with pause. |
|
open fun rxAssign(topicPartition: TopicPartition): Completable
Manually assign a partition to this consumer. open fun rxAssign(topicPartitions: MutableSet<TopicPartition>): Completable
Manually assign a list of partition to this consumer. |
|
open fun rxAssignment(): Single<MutableSet<TopicPartition>>
Get the set of partitions currently assigned to this consumer. |
|
open fun rxBeginningOffsets(topicPartition: TopicPartition): Single<Long>
Get the first offset for the given partitions. |
|
open fun rxClose(): Completable
Close the consumer |
|
open fun rxCommit(): Completable
Commit current offsets for all the subscribed list of topics and partition. |
|
open fun rxCommitted(topicPartition: TopicPartition): Single<OffsetAndMetadata>
Get the last committed offset for the given partition (whether the commit happened by this process or another). |
|
open fun rxEndOffsets(topicPartition: TopicPartition): Single<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. |
|
open fun rxOffsetsForTimes(topicPartition: TopicPartition, timestamp: Long): Single<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 |
|
open fun rxPartitionsFor(topic: String): Single<MutableList<PartitionInfo>>
Get metadata about the partitions for a given topic. |
|
open fun rxPause(topicPartition: TopicPartition): Completable
Suspend fetching from the requested partition. open fun rxPause(topicPartitions: MutableSet<TopicPartition>): Completable
Suspend fetching from the requested partitions. |
|
open fun rxPaused(): Single<MutableSet<TopicPartition>>
Get the set of partitions that were previously paused by a call to pause(Set). |
|
open fun rxPosition(partition: TopicPartition): Single<Long>
Get the offset of the next record that will be fetched (if a record with that offset exists). |
|
open fun rxResume(topicPartition: TopicPartition): Completable
Resume specified partition which have been paused with pause. open fun rxResume(topicPartitions: MutableSet<TopicPartition>): Completable
Resume specified partitions which have been paused with pause. |
|
open fun rxSeek(topicPartition: TopicPartition, offset: Long): Completable
Overrides the fetch offsets that the consumer will use on the next poll. |
|
open fun rxSeekToBeginning(topicPartition: TopicPartition): Completable
Seek to the first offset for each of the given partition. open fun rxSeekToBeginning(topicPartitions: MutableSet<TopicPartition>): Completable
Seek to the first offset for each of the given partitions. |
|
open fun rxSeekToEnd(topicPartition: TopicPartition): Completable
Seek to the last offset for each of the given partition. open fun rxSeekToEnd(topicPartitions: MutableSet<TopicPartition>): Completable
Seek to the last offset for each of the given partitions. |
|
open fun rxSubscribe(topic: String): Completable
Subscribe to the given topic to get dynamically assigned partitions. open fun rxSubscribe(topics: MutableSet<String>): Completable
Subscribe to the given list of topics to get dynamically assigned partitions. |
|
open fun rxSubscription(): Single<MutableSet<String>>
Get the current subscription. |
|
open fun rxUnsubscribe(): Completable
Unsubscribe from topics currently subscribed with subscribe. |
|
open fun seek(topicPartition: TopicPartition, offset: Long): KafkaConsumer<K, V>open 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. |
|
open fun seekToBeginning(topicPartition: TopicPartition): KafkaConsumer<K, V>open fun seekToBeginning(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the first offset for each of the given partition. open fun seekToBeginning(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>open fun seekToBeginning(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the first offset for each of the given partitions. |
|
open fun seekToEnd(topicPartition: TopicPartition): KafkaConsumer<K, V>open fun seekToEnd(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the last offset for each of the given partition. open fun seekToEnd(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>open fun seekToEnd(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the last offset for each of the given partitions. |
|
open fun subscribe(topic: String): KafkaConsumer<K, V>open fun subscribe(topic: String, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Subscribe to the given topic to get dynamically assigned partitions. open fun subscribe(topics: MutableSet<String>): KafkaConsumer<K, V>open fun subscribe(topics: MutableSet<String>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Subscribe to the given list of topics to get dynamically assigned partitions. |
|
open fun subscription(handler: Handler<AsyncResult<MutableSet<String>>>): KafkaConsumer<K, V>
Get the current subscription. |
|
open fun toFlowable(): Flowable<KafkaConsumerRecord<K, V>> |
|
open fun toObservable(): Observable<KafkaConsumerRecord<K, V>> |
|
open fun toString(): String |
|
open fun unsubscribe(): KafkaConsumer<K, V>open fun unsubscribe(completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Unsubscribe from topics currently subscribed with subscribe. |