open class KafkaConsumer<K : Any, V : Any> : ReadStream<KafkaConsumerRecord<K, V>>
Vert.x Kafka consumer.
You receive Kafka records by providing a io.vertx.rxjava.kafka.client.consumer.KafkaConsumer#handler. As messages arrive the handler will be called with the records.
The io.vertx.rxjava.kafka.client.consumer.KafkaConsumer#pause and io.vertx.rxjava.kafka.client.consumer.KafkaConsumer#resume provides global control over reading the records from the consumer.
The io.vertx.rxjava.kafka.client.consumer.KafkaConsumer#pause and io.vertx.rxjava.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>
Manually assign a partition to this consumer. open fun assign(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>
Manually assign a list of partition to this consumer. open fun assign(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Manually assign a partition to this consumer. Due to internal buffering of messages, when reassigning the old partition may remain in effect (as observed by the record handler)} until some time after the given open fun assign(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Manually assign a list of partition to this consumer. Due to internal buffering of messages, when reassigning the old set of partitions may remain in effect (as observed by the record handler)} until some time after the given |
|
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.rxjava.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>
Suspend fetching from the requested partition. open fun pause(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>
Suspend fetching from the requested partitions. open fun pause(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Suspend fetching from the requested partition. Due to internal buffering of messages, the will continue to observe messages from the given open fun pause(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Suspend fetching from the requested partitions. Due to internal buffering of messages, the will continue to observe messages from the given |
|
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 pollTimeout(timeout: Long): KafkaConsumer<K, V>
Sets the poll timeout (in ms) for the underlying native Kafka Consumer. Defaults to 1000. Setting timeout to a lower value results in a more 'responsive' client, because it will block for a shorter period if no data is available in the assigned partition and therefore allows subsequent actions to be executed with a shorter delay. At the same time, the client will poll more frequently and thus will potentially create a higher load on the Kafka Broker. |
|
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): Single<Void>
Manually assign a partition to this consumer. Due to internal buffering of messages, when reassigning the old partition may remain in effect (as observed by the record handler)} until some time after the given open fun rxAssign(topicPartitions: MutableSet<TopicPartition>): Single<Void>
Manually assign a list of partition to this consumer. Due to internal buffering of messages, when reassigning the old set of partitions may remain in effect (as observed by the record handler)} until some time after the given |
|
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(): Single<Void>
Close the consumer |
|
open fun rxCommit(): Single<Void>
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): Single<Void>
Suspend fetching from the requested partition. Due to internal buffering of messages, the will continue to observe messages from the given open fun rxPause(topicPartitions: MutableSet<TopicPartition>): Single<Void>
Suspend fetching from the requested partitions. Due to internal buffering of messages, the will continue to observe messages from the given |
|
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): Single<Void>
Resume specified partition which have been paused with pause. open fun rxResume(topicPartitions: MutableSet<TopicPartition>): Single<Void>
Resume specified partitions which have been paused with pause. |
|
open fun rxSeek(topicPartition: TopicPartition, offset: Long): Single<Void>
Overrides the fetch offsets that the consumer will use on the next poll. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun rxSeekToBeginning(topicPartition: TopicPartition): Single<Void>
Seek to the first offset for each of the given partition. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given open fun rxSeekToBeginning(topicPartitions: MutableSet<TopicPartition>): Single<Void>
Seek to the first offset for each of the given partitions. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun rxSeekToEnd(topicPartition: TopicPartition): Single<Void>
Seek to the last offset for each of the given partition. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given open fun rxSeekToEnd(topicPartitions: MutableSet<TopicPartition>): Single<Void>
Seek to the last offset for each of the given partitions. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun rxSubscribe(topic: String): Single<Void>
Subscribe to the given topic to get dynamically assigned partitions. Due to internal buffering of messages, when changing the subscribed topic the old topic may remain in effect (as observed by the record handler}) until some time after the given open fun rxSubscribe(topics: MutableSet<String>): Single<Void>
Subscribe to the given list of topics to get dynamically assigned partitions. Due to internal buffering of messages, when changing the subscribed topics the old set of topics may remain in effect (as observed by the record handler}) until some time after the given |
|
open fun rxSubscription(): Single<MutableSet<String>>
Get the current subscription. |
|
open fun rxUnsubscribe(): Single<Void>
Unsubscribe from topics currently subscribed with subscribe. |
|
open fun seek(topicPartition: TopicPartition, offset: Long): KafkaConsumer<K, V>
Overrides the fetch offsets that the consumer will use on the next poll. 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. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun seekToBeginning(topicPartition: TopicPartition): KafkaConsumer<K, V>
Seek to the first offset for each of the given partition. open fun seekToBeginning(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>
Seek to the first offset for each of the given partitions. open fun seekToBeginning(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the first offset for each of the given partition. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given open fun seekToBeginning(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the first offset for each of the given partitions. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun seekToEnd(topicPartition: TopicPartition): KafkaConsumer<K, V>
Seek to the last offset for each of the given partition. open fun seekToEnd(topicPartitions: MutableSet<TopicPartition>): KafkaConsumer<K, V>
Seek to the last offset for each of the given partitions. open fun seekToEnd(topicPartition: TopicPartition, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the last offset for each of the given partition. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given open fun seekToEnd(topicPartitions: MutableSet<TopicPartition>, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Seek to the last offset for each of the given partitions. Due to internal buffering of messages, the will continue to observe messages fetched with respect to the old offset until some time after the given |
|
open fun subscribe(topic: String): KafkaConsumer<K, V>
Subscribe to the given topic to get dynamically assigned partitions. open fun subscribe(topics: MutableSet<String>): KafkaConsumer<K, V>
Subscribe to the given list of topics to get dynamically assigned partitions. open fun subscribe(topic: String, completionHandler: Handler<AsyncResult<Void>>): KafkaConsumer<K, V>
Subscribe to the given topic to get dynamically assigned partitions. Due to internal buffering of messages, when changing the subscribed topic the old topic may remain in effect (as observed by the record handler}) until some time after the given 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. Due to internal buffering of messages, when changing the subscribed topics the old set of topics may remain in effect (as observed by the record handler}) until some time after the given |
|
open fun subscription(handler: Handler<AsyncResult<MutableSet<String>>>): KafkaConsumer<K, V>
Get the current subscription. |
|
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. |