class KafkaConsumer[K, V] extends ReadStream[KafkaConsumerRecord[K, V]]
Vert.x Kafka consumer.
You receive Kafka records by providing a io.vertx.scala.kafka.client.consumer.KafkaConsumer#handler. As messages arrive the handler will be called with the records.
The io.vertx.scala.kafka.client.consumer.KafkaConsumer#pause and io.vertx.scala.kafka.client.consumer.KafkaConsumer#resume provides global control over reading the records from the consumer.
The io.vertx.scala.kafka.client.consumer.KafkaConsumer#pause and io.vertx.scala.kafka.client.consumer.KafkaConsumer#resume provides finer grained control over reading records for specific Topic/Partition, these are Kafka's specific operations.
- Alphabetic
- By Inheritance
- KafkaConsumer
- ReadStream
- StreamBase
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new KafkaConsumer(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[K], arg1: scala.reflect.api.JavaUniverse.TypeTag[V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: AnyRef
- Definition Classes
- KafkaConsumer → ReadStream → StreamBase
-
def
assign(topicPartitions: Set[TopicPartition], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Manually assign a list of partition to this consumer.
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
completionHandleris called. In contrast, the once the given
completionHandleris called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new set of partitions. * @param topicPartitions partitions which want assigned
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
assign(topicPartition: TopicPartition, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Manually assign a partition to this consumer.
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
completionHandleris called. In contrast, the once the given
completionHandleris called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new partition. * @param topicPartition partition which want assigned see TopicPartition
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
assign(topicPartitions: Set[TopicPartition]): KafkaConsumer[K, V]
Manually assign a list of partition to this consumer.
Manually assign a list of partition to this consumer. * @param topicPartitions partitions which want assigned
- returns
current KafkaConsumer instance
-
def
assign(topicPartition: TopicPartition): KafkaConsumer[K, V]
Manually assign a partition to this consumer.
Manually assign a partition to this consumer. * @param topicPartition partition which want assigned see TopicPartition
- returns
current KafkaConsumer instance
-
def
assignFuture(topicPartitions: Set[TopicPartition]): Future[Unit]
Like assign but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
assignFuture(topicPartition: TopicPartition): Future[Unit]
Like assign but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
assignment(handler: Handler[AsyncResult[Set[TopicPartition]]]): KafkaConsumer[K, V]
Get the set of partitions currently assigned to this consumer.
Get the set of partitions currently assigned to this consumer. * @param handler handler called on operation completed
- returns
current KafkaConsumer instance
-
def
assignmentFuture(): Future[Set[TopicPartition]]
Like assignment but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
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.
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.scala.kafka.client.consumer.KafkaConsumer. * @param handler handler called when batches of messages are fetched
- returns
current KafkaConsumer instance
-
def
beginningOffsets(topicPartition: TopicPartition, handler: Handler[AsyncResult[Long]]): Unit
Get the first offset for the given partitions.
Get the first offset for the given partitions. * @param topicPartition the partition to get the earliest offset. see TopicPartition
- handler
handler called on operation completed. Returns the earliest available offset for the given partition
-
def
beginningOffsetsFuture(topicPartition: TopicPartition): Future[Long]
Like beginningOffsets but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
close(completionHandler: Handler[AsyncResult[Unit]]): Unit
Close the consumer * @param completionHandler handler called on operation completed
-
def
close(): Unit
Close the consumer
-
def
closeFuture(): Future[Unit]
Like close but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
commit(completionHandler: Handler[AsyncResult[Unit]]): Unit
Commit current offsets for all the subscribed list of topics and partition.
Commit current offsets for all the subscribed list of topics and partition. * @param completionHandler handler called on operation completed
-
def
commit(): Unit
Commit current offsets for all the subscribed list of topics and partition.
-
def
commitFuture(): Future[Unit]
Like commit but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
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).
Get the last committed offset for the given partition (whether the commit happened by this process or another). * @param topicPartition topic partition for getting last committed offset see TopicPartition
- handler
handler called on operation completed
-
def
committedFuture(topicPartition: TopicPartition): Future[OffsetAndMetadata]
Like committed but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
endHandler(endHandler: Handler[Unit]): KafkaConsumer[K, V]
Set an end handler.
Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. * @return a reference to this, so the API can be used fluently
- Definition Classes
- KafkaConsumer → ReadStream
-
def
endOffsets(topicPartition: TopicPartition, handler: Handler[AsyncResult[Long]]): Unit
Get the last offset for the given partition.
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. * @param topicPartition the partition to get the end offset. see TopicPartition
- handler
handler called on operation completed. The end offset for the given partition.
-
def
endOffsetsFuture(topicPartition: TopicPartition): Future[Long]
Like endOffsets but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exceptionHandler(handler: Handler[Throwable]): KafkaConsumer[K, V]
Set an exception handler on the read stream.
Set an exception handler on the read stream. * @param handler the exception handler
- returns
a reference to this, so the API can be used fluently
- Definition Classes
- KafkaConsumer → ReadStream → StreamBase
-
def
fetch(arg0: Long): ReadStream[KafkaConsumerRecord[K, V]]
Fetch the specified
amount
of elements.Fetch the specified
amount
of elements. If theReadStream
has been paused, reading will recommence with the specifiedamount
of items, otherwise the specifiedamount
will be added to the current stream demand. * @return a reference to this, so the API can be used fluently- Definition Classes
- KafkaConsumer → ReadStream
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
handler(handler: Handler[KafkaConsumerRecord[K, V]]): KafkaConsumer[K, V]
Set a data handler.
Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently
- Definition Classes
- KafkaConsumer → ReadStream
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
offsetsForTimes(topicPartition: TopicPartition, timestamp: Long, handler: Handler[AsyncResult[OffsetAndTimestamp]]): Unit
Look up the offset for the given partition by timestamp.
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 * @param topicPartition TopicPartition to query. see TopicPartition
- timestamp
Timestamp to be used in the query.
- handler
handler called on operation completed
-
def
offsetsForTimesFuture(topicPartition: TopicPartition, timestamp: Long): Future[OffsetAndTimestamp]
Like offsetsForTimes but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
partitionsAssignedHandler(handler: Handler[Set[TopicPartition]]): KafkaConsumer[K, V]
Set the handler called when topic partitions are assigned to the consumer * @param handler handler called on assigned topic partitions
Set the handler called when topic partitions are assigned to the consumer * @param handler handler called on assigned topic partitions
- returns
current KafkaConsumer instance
-
def
partitionsFor(topic: String, handler: Handler[AsyncResult[Buffer[PartitionInfo]]]): KafkaConsumer[K, V]
Get metadata about the partitions for a given topic.
Get metadata about the partitions for a given topic. * @param topic topic partition for which getting partitions info
- handler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
partitionsForFuture(topic: String): Future[Buffer[PartitionInfo]]
Like partitionsFor but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
partitionsRevokedHandler(handler: Handler[Set[TopicPartition]]): KafkaConsumer[K, V]
Set the handler called when topic partitions are revoked to the consumer * @param handler handler called on revoked topic partitions
Set the handler called when topic partitions are revoked to the consumer * @param handler handler called on revoked topic partitions
- returns
current KafkaConsumer instance
-
def
pause(topicPartitions: Set[TopicPartition], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Suspend fetching from the requested partitions.
Suspend fetching from the requested partitions.
Due to internal buffering of messages, the will continue to observe messages from the given
topicPartitions
until some time after the givencompletionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will not see messages from the giventopicPartitions
. * @param topicPartitions topic partition from which suspend fetching- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
pause(topicPartition: TopicPartition, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Suspend fetching from the requested partition.
Suspend fetching from the requested partition.
Due to internal buffering of messages, the will continue to observe messages from the given
topicPartition
until some time after the givencompletionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will not see messages from the giventopicPartition
. * @param topicPartition topic partition from which suspend fetching see TopicPartition- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
pause(topicPartitions: Set[TopicPartition]): KafkaConsumer[K, V]
Suspend fetching from the requested partitions.
Suspend fetching from the requested partitions. * @param topicPartitions topic partition from which suspend fetching
- returns
current KafkaConsumer instance
-
def
pause(topicPartition: TopicPartition): KafkaConsumer[K, V]
Suspend fetching from the requested partition.
Suspend fetching from the requested partition. * @param topicPartition topic partition from which suspend fetching see TopicPartition
- returns
current KafkaConsumer instance
-
def
pause(): KafkaConsumer[K, V]
Pause the
ReadStream
, it sets the buffer infetch
mode and clears the actual demand.Pause the
ReadStream
, it sets the buffer infetch
mode and clears the actual demand.While it's paused, no data will be sent to the data
handler
. * @return a reference to this, so the API can be used fluently- Definition Classes
- KafkaConsumer → ReadStream
-
def
pauseFuture(topicPartitions: Set[TopicPartition]): Future[Unit]
Like pause but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
pauseFuture(topicPartition: TopicPartition): Future[Unit]
Like pause but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
paused(handler: Handler[AsyncResult[Set[TopicPartition]]]): Unit
Get the set of partitions that were previously paused by a call to pause(Set).
Get the set of partitions that were previously paused by a call to pause(Set). * @param handler handler called on operation completed
-
def
pausedFuture(): Future[Set[TopicPartition]]
Like paused but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
poll(timeout: Long, handler: Handler[AsyncResult[KafkaConsumerRecords[K, V]]]): Unit
Executes a poll for getting messages from Kafka * @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer.
Executes a poll for getting messages from Kafka * @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
- handler
handler called after the poll with batch of records (can be empty).
-
def
pollFuture(timeout: Long): Future[KafkaConsumerRecords[K, V]]
Like poll but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
pollTimeout(timeout: Long): KafkaConsumer[K, V]
Sets the poll timeout (in ms) for the underlying native Kafka Consumer.
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. * @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
-
def
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).
Get the offset of the next record that will be fetched (if a record with that offset exists). * @param partition The partition to get the position for see TopicPartition
- handler
handler called on operation completed
-
def
positionFuture(partition: TopicPartition): Future[Long]
Like position but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
resume(topicPartitions: Set[TopicPartition], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Resume specified partitions which have been paused with pause.
Resume specified partitions which have been paused with pause. * @param topicPartitions topic partition from which resume fetching
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
resume(topicPartition: TopicPartition, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Resume specified partition which have been paused with pause.
Resume specified partition which have been paused with pause. * @param topicPartition topic partition from which resume fetching see TopicPartition
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
resume(topicPartitions: Set[TopicPartition]): KafkaConsumer[K, V]
Resume specified partitions which have been paused with pause.
Resume specified partitions which have been paused with pause. * @param topicPartitions topic partition from which resume fetching
- returns
current KafkaConsumer instance
-
def
resume(topicPartition: TopicPartition): KafkaConsumer[K, V]
Resume specified partition which have been paused with pause.
Resume specified partition which have been paused with pause. * @param topicPartition topic partition from which resume fetching see TopicPartition
- returns
current KafkaConsumer instance
-
def
resume(): KafkaConsumer[K, V]
Resume reading, and sets the buffer in
flowing
mode.Resume reading, and sets the buffer in
flowing
mode.If the
ReadStream
has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently- Definition Classes
- KafkaConsumer → ReadStream
-
def
resumeFuture(topicPartitions: Set[TopicPartition]): Future[Unit]
Like resume but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
resumeFuture(topicPartition: TopicPartition): Future[Unit]
Like resume but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
seek(topicPartition: TopicPartition, offset: Long, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Overrides the fetch offsets that the consumer will use on the next poll.
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
completionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new offset. * @param topicPartition topic partition for which seek see TopicPartition- offset
offset to seek inside the topic partition
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
seek(topicPartition: TopicPartition, offset: Long): KafkaConsumer[K, V]
Overrides the fetch offsets that the consumer will use on the next poll.
Overrides the fetch offsets that the consumer will use on the next poll. * @param topicPartition topic partition for which seek see TopicPartition
- offset
offset to seek inside the topic partition
- returns
current KafkaConsumer instance
-
def
seekFuture(topicPartition: TopicPartition, offset: Long): Future[Unit]
Like seek but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
seekToBeginning(topicPartitions: Set[TopicPartition], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Seek to the first offset for each of the given partitions.
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
completionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new offset. * @param topicPartitions topic partition for which seek- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
seekToBeginning(topicPartition: TopicPartition, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Seek to the first offset for each of the given partition.
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
completionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new offset. * @param topicPartition topic partition for which seek see TopicPartition- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
seekToBeginning(topicPartitions: Set[TopicPartition]): KafkaConsumer[K, V]
Seek to the first offset for each of the given partitions.
Seek to the first offset for each of the given partitions. * @param topicPartitions topic partition for which seek
- returns
current KafkaConsumer instance
-
def
seekToBeginning(topicPartition: TopicPartition): KafkaConsumer[K, V]
Seek to the first offset for each of the given partition.
Seek to the first offset for each of the given partition. * @param topicPartition topic partition for which seek see TopicPartition
- returns
current KafkaConsumer instance
-
def
seekToBeginningFuture(topicPartitions: Set[TopicPartition]): Future[Unit]
Like seekToBeginning but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
seekToBeginningFuture(topicPartition: TopicPartition): Future[Unit]
Like seekToBeginning but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
seekToEnd(topicPartitions: Set[TopicPartition], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Seek to the last offset for each of the given partitions.
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
completionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new offset. * @param topicPartitions topic partition for which seek- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
seekToEnd(topicPartition: TopicPartition, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Seek to the last offset for each of the given partition.
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
completionHandler
is called. In contrast, the once the givencompletionHandler
is called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new offset. * @param topicPartition topic partition for which seek see TopicPartition- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
seekToEnd(topicPartitions: Set[TopicPartition]): KafkaConsumer[K, V]
Seek to the last offset for each of the given partitions.
Seek to the last offset for each of the given partitions. * @param topicPartitions topic partition for which seek
- returns
current KafkaConsumer instance
-
def
seekToEnd(topicPartition: TopicPartition): KafkaConsumer[K, V]
Seek to the last offset for each of the given partition.
Seek to the last offset for each of the given partition. * @param topicPartition topic partition for which seek see TopicPartition
- returns
current KafkaConsumer instance
-
def
seekToEndFuture(topicPartitions: Set[TopicPartition]): Future[Unit]
Like seekToEnd but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
seekToEndFuture(topicPartition: TopicPartition): Future[Unit]
Like seekToEnd but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
subscribe(topics: Set[String], completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Subscribe to the given list of topics to get dynamically assigned partitions.
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
completionHandleris called. In contrast, the once the given
completionHandleris called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new set of topics. * @param topics topics to subscribe to
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
subscribe(topic: String, completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Subscribe to the given topic to get dynamically assigned partitions.
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
completionHandleris called. In contrast, the once the given
completionHandleris called the io.vertx.scala.kafka.client.consumer.KafkaConsumer#batchHandler will only see messages consistent with the new topic. * @param topic topic to subscribe to
- completionHandler
handler called on operation completed
- returns
current KafkaConsumer instance
-
def
subscribe(topics: Set[String]): KafkaConsumer[K, V]
Subscribe to the given list of topics to get dynamically assigned partitions.
Subscribe to the given list of topics to get dynamically assigned partitions. * @param topics topics to subscribe to
- returns
current KafkaConsumer instance
-
def
subscribe(topic: String): KafkaConsumer[K, V]
Subscribe to the given topic to get dynamically assigned partitions.
Subscribe to the given topic to get dynamically assigned partitions. * @param topic topic to subscribe to
- returns
current KafkaConsumer instance
-
def
subscribeFuture(topics: Set[String]): Future[Unit]
Like subscribe but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
subscribeFuture(topic: String): Future[Unit]
Like subscribe but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
subscription(handler: Handler[AsyncResult[Set[String]]]): KafkaConsumer[K, V]
Get the current subscription.
Get the current subscription. * @param handler handler called on operation completed
- returns
current KafkaConsumer instance
-
def
subscriptionFuture(): Future[Set[String]]
Like subscription but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unsubscribe(completionHandler: Handler[AsyncResult[Unit]]): KafkaConsumer[K, V]
Unsubscribe from topics currently subscribed with subscribe.
Unsubscribe from topics currently subscribed with subscribe. * @param completionHandler handler called on operation completed
- returns
current KafkaConsumer instance
-
def
unsubscribe(): KafkaConsumer[K, V]
Unsubscribe from topics currently subscribed with subscribe.
Unsubscribe from topics currently subscribed with subscribe. * @return current KafkaConsumer instance
-
def
unsubscribeFuture(): Future[Unit]
Like unsubscribe but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )