Class KafkaConsumer<K,V>

java.lang.Object
io.vertx.mutiny.kafka.client.consumer.KafkaConsumer<K,V>
All Implemented Interfaces:
MutinyDelegate, ReadStream<KafkaConsumerRecord<K,V>>, StreamBase

public class KafkaConsumer<K,V> extends Object implements ReadStream<KafkaConsumerRecord<K,V>>, MutinyDelegate
Vert.x Kafka consumer.

You receive Kafka records by providing a KafkaConsumer#handler(Handler). As messages arrive the handler will be called with the records.

The pause() and resume() provides global control over reading the records from the consumer.

The pause(Set) and resume(Set) provides finer grained control over reading records for specific Topic/Partition, these are Kafka's specific operations.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • KafkaConsumer
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream

    ReadStream.ReadStreamImpl<T>

    Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase

    StreamBase.StreamBaseImpl
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<KafkaConsumer>
     
    final TypeArg<K>
     
    final TypeArg<V>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate)
    Create a new instance of KafkaConsumer delegating to the given (non-null) instance of KafkaConsumer.
    KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
     
    KafkaConsumer(Object delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.smallrye.mutiny.Uni<Void>
    assign(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Manually assign a partition to this consumer.
    io.smallrye.mutiny.Uni<Void>
    assign(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Manually assign a list of partition to this consumer.
    void
    assignAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Manually assign a partition to this consumer.
    void
    assignAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Manually assign a list of partition to this consumer.
    assignAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Manually assign a partition to this consumer.
    assignAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Manually assign a list of partition to this consumer.
    io.smallrye.mutiny.Uni<Set<io.vertx.kafka.client.common.TopicPartition>>
    Get the set of partitions currently assigned to this consumer.
    Set<io.vertx.kafka.client.common.TopicPartition>
    Get the set of partitions currently assigned to this consumer.
    Get the set of partitions currently assigned to this consumer.
    Set the handler to be used when batches of messages are fetched from the Kafka server.
    io.smallrye.mutiny.Uni<Long>
    beginningOffsets(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the first offset for the given partitions.
    beginningOffsetsAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the first offset for the given partitions.
    beginningOffsetsAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the first offset for the given partitions.
    io.smallrye.mutiny.Uni<Void>
    Close the consumer
    void
    Close the consumer
    Close the consumer
    io.smallrye.mutiny.Uni<Void>
    Commit current offsets for all the subscribed list of topics and partition.
    void
    Commit current offsets for all the subscribed list of topics and partition.
    Commit current offsets for all the subscribed list of topics and partition.
    io.smallrye.mutiny.Uni<io.vertx.kafka.client.consumer.OffsetAndMetadata>
    committed(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last committed offset for the given partition (whether the commit happened by this process or another).
    io.vertx.kafka.client.consumer.OffsetAndMetadata
    committedAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last committed offset for the given partition (whether the commit happened by this process or another).
    committedAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last committed offset for the given partition (whether the commit happened by this process or another).
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, io.vertx.kafka.client.common.KafkaClientOptions options)
    Create a new KafkaConsumer instance
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, io.vertx.kafka.client.common.KafkaClientOptions options, Class<K> keyType, Class<V> valueType)
    Create a new KafkaConsumer instance
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, Map<String,String> config)
    Create a new KafkaConsumer instance
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, Map<String,String> config, Class<K> keyType, Class<V> valueType)
    Create a new KafkaConsumer instance
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
    Create a new KafkaConsumer instance from a native Consumer.
    static <K, V> KafkaConsumer<K,V>
    create(Vertx vertx, org.apache.kafka.clients.consumer.Consumer<K,V> consumer, io.vertx.kafka.client.common.KafkaClientOptions options)
    Create a new KafkaConsumer instance from a native Consumer.
    long
    Returns the current demand.
    endHandler(Runnable endHandler)
    Set an end handler.
    io.smallrye.mutiny.Uni<Long>
    endOffsets(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last offset for the given partition.
    endOffsetsAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last offset for the given partition.
    endOffsetsAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Get the last offset for the given partition.
    boolean
     
    Set an exception handler on the read stream.
    fetch(long amount)
    Fetch the specified amount of elements.
    io.vertx.kafka.client.consumer.KafkaConsumer<K,V>
    Get the delegate instance.
    Set a data handler.
    int
     
    static <K, V> KafkaConsumer<K,V>
    newInstance(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate)
    Creates a new instance of the KafkaConsumer.
    static <K, V> KafkaConsumer<K,V>
    newInstance(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
    Creates a new instance of the KafkaConsumer.
    io.smallrye.mutiny.Uni<io.vertx.kafka.client.consumer.OffsetAndTimestamp>
    offsetsForTimes(io.vertx.kafka.client.common.TopicPartition topicPartition, Long timestamp)
    Look up the offset for the given partition by timestamp.
    io.vertx.kafka.client.consumer.OffsetAndTimestamp
    offsetsForTimesAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, Long timestamp)
    Look up the offset for the given partition by timestamp.
    offsetsForTimesAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, Long timestamp)
    Look up the offset for the given partition by timestamp.
    partitionsAssignedHandler(Consumer<Set<io.vertx.kafka.client.common.TopicPartition>> handler)
    Set the handler called when topic partitions are assigned to the consumer
    io.smallrye.mutiny.Uni<List<io.vertx.kafka.client.common.PartitionInfo>>
    Get metadata about the partitions for a given topic.
    List<io.vertx.kafka.client.common.PartitionInfo>
    Get metadata about the partitions for a given topic.
    Get metadata about the partitions for a given topic.
    partitionsRevokedHandler(Consumer<Set<io.vertx.kafka.client.common.TopicPartition>> handler)
    Set the handler called when topic partitions are revoked to the consumer
    Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.
    io.smallrye.mutiny.Uni<Void>
    pause(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Suspend fetching from the requested partition.
    io.smallrye.mutiny.Uni<Void>
    pause(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Suspend fetching from the requested partitions.
    void
    pauseAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Suspend fetching from the requested partition.
    void
    pauseAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Suspend fetching from the requested partitions.
    pauseAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Suspend fetching from the requested partition.
    pauseAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Suspend fetching from the requested partitions.
    io.smallrye.mutiny.Uni<Set<io.vertx.kafka.client.common.TopicPartition>>
    Get the set of partitions that were previously paused by a call to pause(Set).
    Set<io.vertx.kafka.client.common.TopicPartition>
    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).
    Pause this stream and return a Pipe to transfer the elements of this stream to a destination WriteStream.
    io.smallrye.mutiny.Uni<Void>
    Pipe this ReadStream to the WriteStream.
    void
    Pipe this ReadStream to the WriteStream.
    Pipe this ReadStream to the WriteStream.
    io.smallrye.mutiny.Uni<KafkaConsumerRecords<K,V>>
    poll(Duration timeout)
    Executes a poll for getting messages from Kafka.
    Executes a poll for getting messages from Kafka.
    Executes a poll for getting messages from Kafka.
    Sets the poll timeout for the underlying native Kafka Consumer.
    io.smallrye.mutiny.Uni<Long>
    position(io.vertx.kafka.client.common.TopicPartition partition)
    Get the offset of the next record that will be fetched (if a record with that offset exists).
    positionAndAwait(io.vertx.kafka.client.common.TopicPartition partition)
    Get the offset of the next record that will be fetched (if a record with that offset exists).
    positionAndForget(io.vertx.kafka.client.common.TopicPartition partition)
    Get the offset of the next record that will be fetched (if a record with that offset exists).
    Resume reading, and sets the buffer in flowing mode.
    io.smallrye.mutiny.Uni<Void>
    resume(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Resume specified partition which have been paused with pause.
    io.smallrye.mutiny.Uni<Void>
    resume(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Resume specified partitions which have been paused with pause.
    void
    resumeAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Resume specified partition which have been paused with pause.
    void
    resumeAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Resume specified partitions which have been paused with pause.
    resumeAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Resume specified partition which have been paused with pause.
    resumeAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Resume specified partitions which have been paused with pause.
    io.smallrye.mutiny.Uni<Void>
    seek(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
    Overrides the fetch offsets that the consumer will use on the next poll.
    io.smallrye.mutiny.Uni<Void>
    seek(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
    Overrides the fetch offsets that the consumer will use on the next poll.
    void
    seekAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
    Overrides the fetch offsets that the consumer will use on the next poll.
    void
    seekAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
    Overrides the fetch offsets that the consumer will use on the next poll.
    seekAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
    Overrides the fetch offsets that the consumer will use on the next poll.
    seekAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
    Overrides the fetch offsets that the consumer will use on the next poll.
    io.smallrye.mutiny.Uni<Void>
    seekToBeginning(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the first offset for each of the given partition.
    io.smallrye.mutiny.Uni<Void>
    seekToBeginning(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the first offset for each of the given partitions.
    void
    seekToBeginningAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the first offset for each of the given partition.
    void
    seekToBeginningAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the first offset for each of the given partitions.
    seekToBeginningAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the first offset for each of the given partition.
    seekToBeginningAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the first offset for each of the given partitions.
    io.smallrye.mutiny.Uni<Void>
    seekToEnd(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the last offset for each of the given partition.
    io.smallrye.mutiny.Uni<Void>
    seekToEnd(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the last offset for each of the given partitions.
    void
    seekToEndAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the last offset for each of the given partition.
    void
    seekToEndAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the last offset for each of the given partitions.
    seekToEndAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
    Seek to the last offset for each of the given partition.
    seekToEndAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
    Seek to the last offset for each of the given partitions.
    io.smallrye.mutiny.Uni<Void>
    Subscribe to the given topic to get dynamically assigned partitions.
    io.smallrye.mutiny.Uni<Void>
    subscribe(Pattern pattern)
    Subscribe to all topics matching specified pattern to get dynamically assigned partitions.
    io.smallrye.mutiny.Uni<Void>
    subscribe(Set<String> topics)
    Subscribe to the given list of topics to get dynamically assigned partitions.
    void
    Subscribe to the given topic to get dynamically assigned partitions.
    void
    Subscribe to all topics matching specified pattern to get dynamically assigned partitions.
    void
    Subscribe to the given list of topics to get dynamically assigned partitions.
    Subscribe to the given topic to get dynamically assigned partitions.
    Subscribe to all topics matching specified pattern to get dynamically assigned partitions.
    Subscribe to the given list of topics to get dynamically assigned partitions.
    io.smallrye.mutiny.Uni<Set<String>>
    Get the current subscription.
    Get the current subscription.
    Get the current subscription.
     
     
    io.smallrye.mutiny.Multi<KafkaConsumerRecord<K,V>>
     
     
    io.smallrye.mutiny.Uni<Void>
    Unsubscribe from topics currently subscribed with subscribe.
    void
    Unsubscribe from topics currently subscribed with subscribe.
    Unsubscribe from topics currently subscribed with subscribe.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • KafkaConsumer

      public KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate)
      Create a new instance of KafkaConsumer delegating to the given (non-null) instance of KafkaConsumer.
    • KafkaConsumer

      public KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
    • KafkaConsumer

      public KafkaConsumer(Object delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
  • Method Details

    • getDelegate

      public io.vertx.kafka.client.consumer.KafkaConsumer<K,V> getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface ReadStream<K>
      Specified by:
      getDelegate in interface StreamBase
      Returns:
      the delegate instance
    • subscribe

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> subscribe(String topic)
      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 #handler(Handler) record handler}) 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 topic.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topic - topic to subscribe to
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.subscribe(String)
    • subscribeAndAwait

      public void subscribeAndAwait(String topic)
      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 #handler(Handler) record handler}) 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 topic.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topic - topic to subscribe to
      See Also:
      • KafkaConsumer.subscribe(String)
    • subscribeAndForget

      public KafkaConsumer<K,V> subscribeAndForget(String topic)
      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 #handler(Handler) record handler}) 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 topic.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topic - topic to subscribe to
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.subscribe(String)
    • subscribe

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> subscribe(Set<String> topics)
      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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topics - topics to subscribe to
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.subscribe(Set)
    • subscribeAndAwait

      public void subscribeAndAwait(Set<String> topics)
      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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topics - topics to subscribe to
      See Also:
      • KafkaConsumer.subscribe(Set)
    • subscribeAndForget

      public KafkaConsumer<K,V> subscribeAndForget(Set<String> topics)
      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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topics - topics to subscribe to
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.subscribe(Set)
    • subscribe

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> subscribe(Pattern pattern)
      Subscribe to all topics matching specified pattern 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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      pattern - Pattern to subscribe to
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.subscribe(Pattern)
    • subscribeAndAwait

      public void subscribeAndAwait(Pattern pattern)
      Subscribe to all topics matching specified pattern 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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      pattern - Pattern to subscribe to
      See Also:
      • KafkaConsumer.subscribe(Pattern)
    • subscribeAndForget

      public KafkaConsumer<K,V> subscribeAndForget(Pattern pattern)
      Subscribe to all topics matching specified pattern 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 #handler(Handler) record handler}) 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 set of topics.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      pattern - Pattern to subscribe to
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.subscribe(Pattern)
    • assign

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> assign(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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 #handler(Handler) record handler)} 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 partition.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - partition which want assigned
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.assign(TopicPartition)
    • assignAndAwait

      public void assignAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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 #handler(Handler) record handler)} 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 partition.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - partition which want assigned
      See Also:
      • KafkaConsumer.assign(TopicPartition)
    • assignAndForget

      public KafkaConsumer<K,V> assignAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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 #handler(Handler) record handler)} 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 partition.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - partition which want assigned
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.assign(TopicPartition)
    • assign

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> assign(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      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 #handler(Handler) record handler)} 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 set of partitions.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartitions - partitions which want assigned
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.assign(Set)
    • assignAndAwait

      public void assignAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      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 #handler(Handler) record handler)} 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 set of partitions.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartitions - partitions which want assigned
      See Also:
      • KafkaConsumer.assign(Set)
    • assignAndForget

      public KafkaConsumer<K,V> assignAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      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 #handler(Handler) record handler)} 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 set of partitions.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartitions - partitions which want assigned
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.assign(Set)
    • assignment

      @CheckReturnValue public io.smallrye.mutiny.Uni<Set<io.vertx.kafka.client.common.TopicPartition>> assignment()
      Get the set of partitions currently assigned to this consumer.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.assignment()
    • assignmentAndAwait

      public Set<io.vertx.kafka.client.common.TopicPartition> assignmentAndAwait()
      Get the set of partitions currently assigned to this consumer.

      Unlike the bare Vert.x variant, this method returns a Set<io.vertx.kafka.client.common.TopicPartition>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • KafkaConsumer.assignment()
    • assignmentAndForget

      public KafkaConsumer<K,V> assignmentAndForget()
      Get the set of partitions currently assigned to this consumer.

      Unlike the bare Vert.x variant, this method ignores the Set<io.vertx.kafka.client.common.TopicPartition> result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.assignment()
    • unsubscribe

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> unsubscribe()
      Unsubscribe from topics currently subscribed with subscribe.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.unsubscribe()
    • unsubscribeAndAwait

      public void unsubscribeAndAwait()
      Unsubscribe from topics currently subscribed with subscribe.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • KafkaConsumer.unsubscribe()
    • unsubscribeAndForget

      public KafkaConsumer<K,V> unsubscribeAndForget()
      Unsubscribe from topics currently subscribed with subscribe.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.unsubscribe()
    • subscription

      @CheckReturnValue public io.smallrye.mutiny.Uni<Set<String>> subscription()
      Get the current subscription.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.subscription()
    • subscriptionAndAwait

      public Set<String> subscriptionAndAwait()
      Get the current subscription.

      Unlike the bare Vert.x variant, this method returns a Set<String>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • KafkaConsumer.subscription()
    • subscriptionAndForget

      public KafkaConsumer<K,V> subscriptionAndForget()
      Get the current subscription.

      Unlike the bare Vert.x variant, this method ignores the Set<String> result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.subscription()
    • pause

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> pause(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Suspend fetching from the requested partition.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartition until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartition.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition from which suspend fetching
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.pause(TopicPartition)
    • pauseAndAwait

      public void pauseAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Suspend fetching from the requested partition.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartition until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartition.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition from which suspend fetching
      See Also:
      • KafkaConsumer.pause(TopicPartition)
    • pauseAndForget

      public KafkaConsumer<K,V> pauseAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Suspend fetching from the requested partition.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartition until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartition.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition from which suspend fetching
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.pause(TopicPartition)
    • pause

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> pause(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Suspend fetching from the requested partitions.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartitions until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartitions.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartitions - topic partition from which suspend fetching
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.pause(Set)
    • pauseAndAwait

      public void pauseAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Suspend fetching from the requested partitions.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartitions until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartitions.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartitions - topic partition from which suspend fetching
      See Also:
      • KafkaConsumer.pause(Set)
    • pauseAndForget

      public KafkaConsumer<K,V> pauseAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Suspend fetching from the requested partitions.

      Due to internal buffering of messages, the record handler will continue to observe messages from the given topicPartitions until some time after the given completionHandler is called. In contrast, the once the given completionHandler is called the #batchHandler(Handler) will not see messages from the given topicPartitions.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartitions - topic partition from which suspend fetching
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.pause(Set)
    • paused

      @CheckReturnValue public io.smallrye.mutiny.Uni<Set<io.vertx.kafka.client.common.TopicPartition>> paused()
      Get the set of partitions that were previously paused by a call to pause(Set).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.paused()
    • pausedAndAwait

      public Set<io.vertx.kafka.client.common.TopicPartition> pausedAndAwait()
      Get the set of partitions that were previously paused by a call to pause(Set).

      Unlike the bare Vert.x variant, this method returns a Set<io.vertx.kafka.client.common.TopicPartition>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • KafkaConsumer.paused()
    • pausedAndForget

      public KafkaConsumer<K,V> pausedAndForget()
      Get the set of partitions that were previously paused by a call to pause(Set).

      Unlike the bare Vert.x variant, this method ignores the Set<io.vertx.kafka.client.common.TopicPartition> result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.paused()
    • resume

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> resume(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Resume specified partition which have been paused with pause.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition from which resume fetching
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.resume(TopicPartition)
    • resumeAndAwait

      public void resumeAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Resume specified partition which have been paused with pause.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition from which resume fetching
      See Also:
      • KafkaConsumer.resume(TopicPartition)
    • resumeAndForget

      public KafkaConsumer<K,V> resumeAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Resume specified partition which have been paused with pause.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition from which resume fetching
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.resume(TopicPartition)
    • resume

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> resume(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Resume specified partitions which have been paused with pause.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartitions - topic partition from which resume fetching
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.resume(Set)
    • resumeAndAwait

      public void resumeAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Resume specified partitions which have been paused with pause.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartitions - topic partition from which resume fetching
      See Also:
      • KafkaConsumer.resume(Set)
    • resumeAndForget

      public KafkaConsumer<K,V> resumeAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Resume specified partitions which have been paused with pause.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartitions - topic partition from which resume fetching
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.resume(Set)
    • seek

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seek(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition for which seek
      offset - offset to seek inside the topic partition
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seek(TopicPartition, long)
    • seekAndAwait

      public void seekAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition for which seek
      offset - offset to seek inside the topic partition
      See Also:
      • KafkaConsumer.seek(TopicPartition, long)
    • seekAndForget

      public KafkaConsumer<K,V> seekAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset)
      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition for which seek
      offset - offset to seek inside the topic partition
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seek(TopicPartition, long)
    • seek

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seek(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition for which seek
      offsetAndMetadata - offset to seek inside the topic partition
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seek(TopicPartition, OffsetAndMetadata)
    • seekAndAwait

      public void seekAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition for which seek
      offsetAndMetadata - offset to seek inside the topic partition
      See Also:
      • KafkaConsumer.seek(TopicPartition, OffsetAndMetadata)
    • seekAndForget

      public KafkaConsumer<K,V> seekAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, io.vertx.kafka.client.consumer.OffsetAndMetadata offsetAndMetadata)
      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition for which seek
      offsetAndMetadata - offset to seek inside the topic partition
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seek(TopicPartition, OffsetAndMetadata)
    • seekToBeginning

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seekToBeginning(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the first offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition for which seek
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seekToBeginning(TopicPartition)
    • seekToBeginningAndAwait

      public void seekToBeginningAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the first offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition for which seek
      See Also:
      • KafkaConsumer.seekToBeginning(TopicPartition)
    • seekToBeginningAndForget

      public KafkaConsumer<K,V> seekToBeginningAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the first offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition for which seek
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seekToBeginning(TopicPartition)
    • seekToBeginning

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seekToBeginning(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the first offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartitions - topic partition for which seek
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seekToBeginning(Set)
    • seekToBeginningAndAwait

      public void seekToBeginningAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the first offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartitions - topic partition for which seek
      See Also:
      • KafkaConsumer.seekToBeginning(Set)
    • seekToBeginningAndForget

      public KafkaConsumer<K,V> seekToBeginningAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the first offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartitions - topic partition for which seek
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seekToBeginning(Set)
    • seekToEnd

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seekToEnd(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the last offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition for which seek
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seekToEnd(TopicPartition)
    • seekToEndAndAwait

      public void seekToEndAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the last offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition for which seek
      See Also:
      • KafkaConsumer.seekToEnd(TopicPartition)
    • seekToEndAndForget

      public KafkaConsumer<K,V> seekToEndAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Seek to the last offset for each of the given partition.

      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartition - topic partition for which seek
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seekToEnd(TopicPartition)
    • seekToEnd

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> seekToEnd(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the last offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartitions - topic partition for which seek
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.seekToEnd(Set)
    • seekToEndAndAwait

      public void seekToEndAndAwait(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the last offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartitions - topic partition for which seek
      See Also:
      • KafkaConsumer.seekToEnd(Set)
    • seekToEndAndForget

      public KafkaConsumer<K,V> seekToEndAndForget(Set<io.vertx.kafka.client.common.TopicPartition> topicPartitions)
      Seek to the last offset for each of the given partitions.

      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.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      topicPartitions - topic partition for which seek
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.seekToEnd(Set)
    • commit

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> commit()
      Commit current offsets for all the subscribed list of topics and partition.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.commit()
    • commitAndAwait

      public void commitAndAwait()
      Commit current offsets for all the subscribed list of topics and partition.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • KafkaConsumer.commit()
    • commitAndForget

      public KafkaConsumer<K,V> commitAndForget()
      Commit current offsets for all the subscribed list of topics and partition.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.commit()
    • committed

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.kafka.client.consumer.OffsetAndMetadata> committed(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the last committed offset for the given partition (whether the commit happened by this process or another).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - topic partition for getting last committed offset
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.committed(TopicPartition)
    • committedAndAwait

      public io.vertx.kafka.client.consumer.OffsetAndMetadata committedAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the last committed offset for the given partition (whether the commit happened by this process or another).

      Unlike the bare Vert.x variant, this method returns a OffsetAndMetadata. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - topic partition for getting last committed offset
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.committed(TopicPartition)
    • committedAndForget

      public KafkaConsumer<K,V> committedAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the last committed offset for the given partition (whether the commit happened by this process or another).

      Unlike the bare Vert.x variant, this method ignores the OffsetAndMetadata result or any failure.

      Parameters:
      topicPartition - topic partition for getting last committed offset
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.committed(TopicPartition)
    • partitionsFor

      @CheckReturnValue public io.smallrye.mutiny.Uni<List<io.vertx.kafka.client.common.PartitionInfo>> partitionsFor(String topic)
      Get metadata about the partitions for a given topic.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topic - topic partition for which getting partitions info
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.partitionsFor(String)
    • partitionsForAndAwait

      public List<io.vertx.kafka.client.common.PartitionInfo> partitionsForAndAwait(String topic)
      Get metadata about the partitions for a given topic.

      Unlike the bare Vert.x variant, this method returns a List<io.vertx.kafka.client.common.PartitionInfo>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topic - topic partition for which getting partitions info
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.partitionsFor(String)
    • partitionsForAndForget

      public KafkaConsumer<K,V> partitionsForAndForget(String topic)
      Get metadata about the partitions for a given topic.

      Unlike the bare Vert.x variant, this method ignores the List<io.vertx.kafka.client.common.PartitionInfo> result or any failure.

      Parameters:
      topic - topic partition for which getting partitions info
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.partitionsFor(String)
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Close the consumer

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.close()
    • closeAndAwait

      public void closeAndAwait()
      Close the consumer

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • KafkaConsumer.close()
    • closeAndForget

      public KafkaConsumer<K,V> closeAndForget()
      Close the consumer

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.close()
    • position

      @CheckReturnValue public io.smallrye.mutiny.Uni<Long> position(io.vertx.kafka.client.common.TopicPartition partition)
      Get the offset of the next record that will be fetched (if a record with that offset exists).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      partition - The partition to get the position for
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.position(TopicPartition)
    • positionAndAwait

      public Long positionAndAwait(io.vertx.kafka.client.common.TopicPartition partition)
      Get the offset of the next record that will be fetched (if a record with that offset exists).

      Unlike the bare Vert.x variant, this method returns a Long. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      partition - The partition to get the position for
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.position(TopicPartition)
    • positionAndForget

      public KafkaConsumer<K,V> positionAndForget(io.vertx.kafka.client.common.TopicPartition partition)
      Get the offset of the next record that will be fetched (if a record with that offset exists).

      Unlike the bare Vert.x variant, this method ignores the Long result or any failure.

      Parameters:
      partition - The partition to get the position for
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.position(TopicPartition)
    • offsetsForTimes

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.kafka.client.consumer.OffsetAndTimestamp> offsetsForTimes(io.vertx.kafka.client.common.TopicPartition topicPartition, Long 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

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - TopicPartition to query.
      timestamp - Timestamp to be used in the query.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.offsetsForTimes(TopicPartition, Long)
    • offsetsForTimesAndAwait

      public io.vertx.kafka.client.consumer.OffsetAndTimestamp offsetsForTimesAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, Long 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

      Unlike the bare Vert.x variant, this method returns a OffsetAndTimestamp. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - TopicPartition to query.
      timestamp - Timestamp to be used in the query.
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.offsetsForTimes(TopicPartition, Long)
    • offsetsForTimesAndForget

      public KafkaConsumer<K,V> offsetsForTimesAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition, Long 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

      Unlike the bare Vert.x variant, this method ignores the OffsetAndTimestamp result or any failure.

      Parameters:
      topicPartition - TopicPartition to query.
      timestamp - Timestamp to be used in the query.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.offsetsForTimes(TopicPartition, Long)
    • beginningOffsets

      @CheckReturnValue public io.smallrye.mutiny.Uni<Long> beginningOffsets(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the first offset for the given partitions.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - the partition to get the earliest offset.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.beginningOffsets(TopicPartition)
    • beginningOffsetsAndAwait

      public Long beginningOffsetsAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the first offset for the given partitions.

      Unlike the bare Vert.x variant, this method returns a Long. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - the partition to get the earliest offset.
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.beginningOffsets(TopicPartition)
    • beginningOffsetsAndForget

      public KafkaConsumer<K,V> beginningOffsetsAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      Get the first offset for the given partitions.

      Unlike the bare Vert.x variant, this method ignores the Long result or any failure.

      Parameters:
      topicPartition - the partition to get the earliest offset.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.beginningOffsets(TopicPartition)
    • endOffsets

      @CheckReturnValue public io.smallrye.mutiny.Uni<Long> endOffsets(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      topicPartition - the partition to get the end offset.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.endOffsets(TopicPartition)
    • endOffsetsAndAwait

      public Long endOffsetsAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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.

      Unlike the bare Vert.x variant, this method returns a Long. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      topicPartition - the partition to get the end offset.
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.endOffsets(TopicPartition)
    • endOffsetsAndForget

      public KafkaConsumer<K,V> endOffsetsAndForget(io.vertx.kafka.client.common.TopicPartition topicPartition)
      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.

      Unlike the bare Vert.x variant, this method ignores the Long result or any failure.

      Parameters:
      topicPartition - the partition to get the end offset.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.endOffsets(TopicPartition)
    • poll

      @CheckReturnValue public io.smallrye.mutiny.Uni<KafkaConsumerRecords<K,V>> poll(Duration timeout)
      Executes a poll for getting messages from Kafka.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      timeout - The maximum time to block (must not be greater than Long.MAX_VALUE milliseconds)
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • KafkaConsumer.poll(Duration)
    • pollAndAwait

      public KafkaConsumerRecords<K,V> pollAndAwait(Duration timeout)
      Executes a poll for getting messages from Kafka.

      Unlike the bare Vert.x variant, this method returns a KafkaConsumerRecords<K,V>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      timeout - The maximum time to block (must not be greater than Long.MAX_VALUE milliseconds)
      Returns:
      The operation result
      See Also:
      • KafkaConsumer.poll(Duration)
    • pollAndForget

      public KafkaConsumer<K,V> pollAndForget(Duration timeout)
      Executes a poll for getting messages from Kafka.

      Unlike the bare Vert.x variant, this method ignores the KafkaConsumerRecords<K,V> result or any failure.

      Parameters:
      timeout - The maximum time to block (must not be greater than Long.MAX_VALUE milliseconds)
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • KafkaConsumer.poll(Duration)
    • pipeTo

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<KafkaConsumerRecord<K,V>> dst)
      Pipe this ReadStream to the WriteStream.

      Elements emitted by this stream will be written to the write stream until this stream ends or fails.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Specified by:
      pipeTo in interface ReadStream<K>
      Parameters:
      dst - the destination write stream
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • io.vertx.kafka.client.consumer.KafkaConsumer#pipeTo(WriteStream)
    • pipeToAndAwait

      public void pipeToAndAwait(WriteStream<KafkaConsumerRecord<K,V>> dst)
      Pipe this ReadStream to the WriteStream.

      Elements emitted by this stream will be written to the write stream until this stream ends or fails.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      dst - the destination write stream
      See Also:
      • io.vertx.kafka.client.consumer.KafkaConsumer#pipeTo(WriteStream)
    • pipeToAndForget

      public KafkaConsumer<K,V> pipeToAndForget(WriteStream<KafkaConsumerRecord<K,V>> dst)
      Pipe this ReadStream to the WriteStream.

      Elements emitted by this stream will be written to the write stream until this stream ends or fails.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      dst - the destination write stream
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • io.vertx.kafka.client.consumer.KafkaConsumer#pipeTo(WriteStream)
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
      Create a new KafkaConsumer instance from a native Consumer.
      Parameters:
      vertx - Vert.x instance to use
      consumer - the Kafka consumer to wrap
      Returns:
      an instance of the KafkaConsumer
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, org.apache.kafka.clients.consumer.Consumer<K,V> consumer, io.vertx.kafka.client.common.KafkaClientOptions options)
      Create a new KafkaConsumer instance from a native Consumer.
      Parameters:
      vertx - Vert.x instance to use
      consumer - the Kafka consumer to wrap
      options - options used only for tracing settings
      Returns:
      an instance of the KafkaConsumer
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, Map<String,String> config)
      Create a new KafkaConsumer instance
      Parameters:
      vertx - Vert.x instance to use
      config - Kafka consumer configuration
      Returns:
      an instance of the KafkaConsumer
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, Map<String,String> config, Class<K> keyType, Class<V> valueType)
      Create a new KafkaConsumer instance
      Parameters:
      vertx - Vert.x instance to use
      config - Kafka consumer configuration
      keyType - class type for the key deserialization
      valueType - class type for the value deserialization
      Returns:
      an instance of the KafkaConsumer
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, io.vertx.kafka.client.common.KafkaClientOptions options)
      Create a new KafkaConsumer instance
      Parameters:
      vertx - Vert.x instance to use
      options - Kafka consumer options
      Returns:
      an instance of the KafkaConsumer
    • create

      public static <K, V> KafkaConsumer<K,V> create(Vertx vertx, io.vertx.kafka.client.common.KafkaClientOptions options, Class<K> keyType, Class<V> valueType)
      Create a new KafkaConsumer instance
      Parameters:
      vertx - Vert.x instance to use
      options - Kafka consumer options
      keyType - class type for the key deserialization
      valueType - class type for the value deserialization
      Returns:
      an instance of the KafkaConsumer
    • exceptionHandler

      public KafkaConsumer<K,V> exceptionHandler(Consumer<Throwable> handler)
      Description copied from interface: ReadStream
      Set an exception handler on the read stream.
      Specified by:
      exceptionHandler in interface ReadStream<K>
      Specified by:
      exceptionHandler in interface StreamBase
      Parameters:
      handler - the exception handler. Can be null.
      Returns:
      a reference to this, so the API can be used fluently
    • handler

      public KafkaConsumer<K,V> handler(Consumer<KafkaConsumerRecord<K,V>> handler)
      Description copied from interface: ReadStream
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
      handler in interface ReadStream<K>
      Returns:
      a reference to this, so the API can be used fluently
    • pause

      public KafkaConsumer<K,V> pause()
      Description copied from interface: ReadStream
      Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

      While it's paused, no data will be sent to the data handler.

      Specified by:
      pause in interface ReadStream<K>
      Returns:
      a reference to this, so the API can be used fluently
    • resume

      public KafkaConsumer<K,V> resume()
      Description copied from interface: ReadStream
      Resume reading, and sets the buffer in flowing mode.

      If the ReadStream has been paused, reading will recommence on it.

      Specified by:
      resume in interface ReadStream<K>
      Returns:
      a reference to this, so the API can be used fluently
    • fetch

      public KafkaConsumer<K,V> fetch(long amount)
      Description copied from interface: ReadStream
      Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand.
      Specified by:
      fetch in interface ReadStream<K>
      Returns:
      a reference to this, so the API can be used fluently
    • endHandler

      public KafkaConsumer<K,V> endHandler(Runnable endHandler)
      Description copied from interface: ReadStream
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
      endHandler in interface ReadStream<K>
      Returns:
      a reference to this, so the API can be used fluently
    • demand

      public long demand()
      Returns the current demand.
        If the stream is in flowing mode will return Long.MAX_VALUE.
      • If the stream is in fetch mode, will return the current number of elements still to be delivered or 0 if paused.
      Returns:
      current demand
    • partitionsRevokedHandler

      public KafkaConsumer<K,V> partitionsRevokedHandler(Consumer<Set<io.vertx.kafka.client.common.TopicPartition>> handler)
      Set the handler called when topic partitions are revoked to the consumer
      Parameters:
      handler - handler called on revoked topic partitions
      Returns:
      current KafkaConsumer instance
    • partitionsAssignedHandler

      public KafkaConsumer<K,V> partitionsAssignedHandler(Consumer<Set<io.vertx.kafka.client.common.TopicPartition>> handler)
      Set the handler called when topic partitions are assigned to the consumer
      Parameters:
      handler - handler called on assigned topic partitions
      Returns:
      current KafkaConsumer instance
    • batchHandler

      public KafkaConsumer<K,V> batchHandler(Consumer<KafkaConsumerRecords<K,V>> handler)
      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 record handler.
      Parameters:
      handler - handler called when batches of messages are fetched
      Returns:
      current KafkaConsumer instance
    • pollTimeout

      public KafkaConsumer<K,V> pollTimeout(Duration timeout)
      Sets the poll timeout for the underlying native Kafka Consumer. Defaults to 1000ms. 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.
      Parameters:
      timeout - The time, 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.
    • pipe

      public Pipe<KafkaConsumerRecord<K,V>> pipe()
      Pause this stream and return a Pipe to transfer the elements of this stream to a destination WriteStream.

      The stream will be resumed when the pipe will be wired to a WriteStream.

      Specified by:
      pipe in interface ReadStream<K>
      Returns:
      a pipe
    • newInstance

      public static <K, V> KafkaConsumer<K,V> newInstance(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate)
      Creates a new instance of the KafkaConsumer.
    • newInstance

      public static <K, V> KafkaConsumer<K,V> newInstance(io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1)
      Creates a new instance of the KafkaConsumer.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toMulti

      @CheckReturnValue public io.smallrye.mutiny.Multi<KafkaConsumerRecord<K,V>> toMulti()
    • toBlockingIterable

      public Iterable<KafkaConsumerRecord<K,V>> toBlockingIterable()
    • toBlockingStream

      public Stream<KafkaConsumerRecord<K,V>> toBlockingStream()