Class KafkaConsumer<K,V>
- All Implemented Interfaces:
MutinyDelegate,ReadStream<KafkaConsumerRecord<K,,V>> StreamBase
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 -
Constructor Summary
ConstructorsConstructorDescriptionKafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K, V> delegate) Create a new instance ofKafkaConsumerdelegating to the given (non-null) instance ofKafkaConsumer.KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer<K, V> delegate, TypeArg<K> typeArg_0, TypeArg<V> typeArg_1) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>assign(io.vertx.kafka.client.common.TopicPartition topicPartition) Manually assign a partition to this consumer.io.smallrye.mutiny.Uni<Void>Manually assign a list of partition to this consumer.voidassignAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition) Manually assign a partition to this consumer.voidassignAndAwait(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.batchHandler(Consumer<KafkaConsumerRecords<K, V>> handler) 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()Close the consumervoidClose the consumerClose the consumerio.smallrye.mutiny.Uni<Void>commit()Commit current offsets for all the subscribed list of topics and partition.voidCommit 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.OffsetAndMetadatacommittedAndAwait(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 a new KafkaConsumer instancestatic <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 instancestatic <K,V> KafkaConsumer<K, V> Create a new KafkaConsumer instancestatic <K,V> KafkaConsumer<K, V> Create a new KafkaConsumer instancestatic <K,V> KafkaConsumer<K, V> Create a new KafkaConsumer instance from a nativeConsumer.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 nativeConsumer.longdemand()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.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.Get the delegate instance.handler(Consumer<KafkaConsumerRecord<K, V>> handler) Set a data handler.inthashCode()static <K,V> KafkaConsumer<K, V> newInstance(io.vertx.kafka.client.consumer.KafkaConsumer<K, V> delegate) Creates a new instance of theKafkaConsumer.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 theKafkaConsumer.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.OffsetAndTimestampoffsetsForTimesAndAwait(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 consumerio.smallrye.mutiny.Uni<List<io.vertx.kafka.client.common.PartitionInfo>>partitionsFor(String topic) Get metadata about the partitions for a given topic.List<io.vertx.kafka.client.common.PartitionInfo>partitionsForAndAwait(String topic) Get metadata about the partitions for a given topic.partitionsForAndForget(String 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 consumerpause()Pause theReadStream, it sets the buffer infetchmode 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>Suspend fetching from the requested partitions.voidpauseAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition) Suspend fetching from the requested partition.voidpauseAndAwait(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>>paused()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).pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<KafkaConsumerRecord<K, V>> dst) Pipe thisReadStreamto theWriteStream.voidPipe thisReadStreamto theWriteStream.Pipe thisReadStreamto theWriteStream.io.smallrye.mutiny.Uni<KafkaConsumerRecords<K,V>> Executes a poll for getting messages from Kafka.pollAndAwait(Duration timeout) Executes a poll for getting messages from Kafka.pollAndForget(Duration timeout) Executes a poll for getting messages from Kafka.pollTimeout(Duration timeout) 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()Resume reading, and sets the buffer inflowingmode.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 specified partitions which have been paused with pause.voidresumeAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition) Resume specified partition which have been paused with pause.voidresumeAndAwait(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.voidseekAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition, long offset) Overrides the fetch offsets that the consumer will use on the next poll.voidseekAndAwait(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.voidseekToBeginningAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition) Seek to the first offset for each of the given partition.voidseekToBeginningAndAwait(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>Seek to the last offset for each of the given partitions.voidseekToEndAndAwait(io.vertx.kafka.client.common.TopicPartition topicPartition) Seek to the last offset for each of the given partition.voidseekToEndAndAwait(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 to all topics matching specified pattern to get dynamically assigned partitions.io.smallrye.mutiny.Uni<Void>Subscribe to the given list of topics to get dynamically assigned partitions.voidsubscribeAndAwait(String topic) Subscribe to the given topic to get dynamically assigned partitions.voidsubscribeAndAwait(Pattern pattern) Subscribe to all topics matching specified pattern to get dynamically assigned partitions.voidsubscribeAndAwait(Set<String> topics) Subscribe to the given list of topics to get dynamically assigned partitions.subscribeAndForget(String topic) Subscribe to the given topic to get dynamically assigned partitions.subscribeAndForget(Pattern pattern) Subscribe to all topics matching specified pattern to get dynamically assigned partitions.subscribeAndForget(Set<String> topics) Subscribe to the given list of topics to get dynamically assigned partitions.Get the current subscription.Get the current subscription.Get the current subscription.io.smallrye.mutiny.Multi<KafkaConsumerRecord<K,V>> toMulti()toString()io.smallrye.mutiny.Uni<Void>Unsubscribe from topics currently subscribed with subscribe.voidUnsubscribe from topics currently subscribed with subscribe.Unsubscribe from topics currently subscribed with subscribe.
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
__typeArg_1
-
-
Constructor Details
-
KafkaConsumer
Create a new instance ofKafkaConsumerdelegating to the given (non-null) instance ofKafkaConsumer. -
KafkaConsumer
-
KafkaConsumer
-
-
Method Details
-
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:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<K>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
subscribe
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.subscribe(String)
-
subscribeAndAwait
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- Parameters:
topic- topic to subscribe to- See Also:
-
KafkaConsumer.subscribe(String)
-
subscribeAndForget
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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new topic.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
topic- topic to subscribe to- Returns:
- The current instance to chain operations if needed.
- See Also:
-
KafkaConsumer.subscribe(String)
-
subscribe
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.subscribe(Set)
-
subscribeAndAwait
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- Parameters:
topics- topics to subscribe to- See Also:
-
KafkaConsumer.subscribe(Set)
-
subscribeAndForget
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Voidresult or any failure.- Parameters:
topics- topics to subscribe to- Returns:
- The current instance to chain operations if needed.
- See Also:
-
KafkaConsumer.subscribe(Set)
-
subscribe
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.subscribe(Pattern)
-
subscribeAndAwait
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- Parameters:
pattern- Pattern to subscribe to- See Also:
-
KafkaConsumer.subscribe(Pattern)
-
subscribeAndForget
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new partition.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.assign(Set)
-
assignAndAwait
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Voidresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.assignment()
-
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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
KafkaConsumer.assignment()
-
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
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
Unirepresenting 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 aRuntimeException).- See Also:
-
KafkaConsumer.unsubscribe()
-
unsubscribeAndForget
Unsubscribe from topics currently subscribed with subscribe.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
KafkaConsumer.unsubscribe()
-
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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.subscription()
-
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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
KafkaConsumer.subscription()
-
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
topicPartitionuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartition.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
Unirepresenting 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
topicPartitionuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartition.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 aRuntimeException).- 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
topicPartitionuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartition.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
topicPartitionsuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartitions.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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.pause(Set)
-
pauseAndAwait
Suspend fetching from the requested partitions.Due to internal buffering of messages, the record handler will continue to observe messages from the given
topicPartitionsuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartitions.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 aRuntimeException).- 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
topicPartitionsuntil some time after the givencompletionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will not see messages from the giventopicPartitions.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.paused()
-
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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
KafkaConsumer.paused()
-
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
Unirepresenting 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 aRuntimeException).- 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
Voidresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.resume(Set)
-
resumeAndAwait
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 aRuntimeException).- 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
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 seekoffset- offset to seek inside the topic partition- Returns:
- A
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- Parameters:
topicPartition- topic partition for which seekoffset- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
topicPartition- topic partition for which seekoffset- 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 seekoffsetAndMetadata- offset to seek inside the topic partition- Returns:
- A
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- Parameters:
topicPartition- topic partition for which seekoffsetAndMetadata- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
topicPartition- topic partition for which seekoffsetAndMetadata- 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
completionHandleris called. In contrast, the once the givencompletionHandleris 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.seekToEnd(Set)
-
seekToEndAndAwait
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
completionHandleris called. In contrast, the once the givencompletionHandleris 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 aRuntimeException).- 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
completionHandleris called. In contrast, the once the givencompletionHandleris called the#batchHandler(Handler)will only see messages consistent with the new offset.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
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
Unirepresenting 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 aRuntimeException).- See Also:
-
KafkaConsumer.commit()
-
commitAndForget
Commit current offsets for all the subscribed list of topics and partition.Unlike the bare Vert.x variant, this method ignores the
Voidresult 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
Unirepresenting 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 aRuntimeException).- 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
OffsetAndMetadataresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.partitionsFor(String)
-
partitionsForAndAwait
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 aRuntimeException).- Parameters:
topic- topic partition for which getting partitions info- Returns:
- The operation result
- See Also:
-
KafkaConsumer.partitionsFor(String)
-
partitionsForAndForget
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
Close the consumerUnlike 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.close()
-
closeAndAwait
public void closeAndAwait()Close the consumerUnlike 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 aRuntimeException).- See Also:
-
KafkaConsumer.close()
-
closeAndForget
Close the consumerUnlike the bare Vert.x variant, this method ignores the
Voidresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.position(TopicPartition)
-
positionAndAwait
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 aRuntimeException).- Parameters:
partition- The partition to get the position for- Returns:
- The operation result
- See Also:
-
KafkaConsumer.position(TopicPartition)
-
positionAndForget
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
Longresult 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 futureUnlike 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
Unirepresenting 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 futureUnlike 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 aRuntimeException).- 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 futureUnlike the bare Vert.x variant, this method ignores the
OffsetAndTimestampresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.beginningOffsets(TopicPartition)
-
beginningOffsetsAndAwait
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 aRuntimeException).- 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
Longresult 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.endOffsets(TopicPartition)
-
endOffsetsAndAwait
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 aRuntimeException).- 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
Longresult 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
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 thanLong.MAX_VALUEmilliseconds)- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
KafkaConsumer.poll(Duration)
-
pollAndAwait
Executes a poll for getting messages from Kafka.Unlike the bare Vert.x variant, this method returns a
KafkaConsumerRecords<K,. 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 aV> RuntimeException).- Parameters:
timeout- The maximum time to block (must not be greater thanLong.MAX_VALUEmilliseconds)- Returns:
- The operation result
- See Also:
-
KafkaConsumer.poll(Duration)
-
pollAndForget
Executes a poll for getting messages from Kafka.Unlike the bare Vert.x variant, this method ignores the
KafkaConsumerRecords<K,result or any failure.V> - Parameters:
timeout- The maximum time to block (must not be greater thanLong.MAX_VALUEmilliseconds)- 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 thisReadStreamto theWriteStream.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:
pipeToin interfaceReadStream<K>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.kafka.client.consumer.KafkaConsumer#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.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 aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.kafka.client.consumer.KafkaConsumer#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.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
Voidresult 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 nativeConsumer.- Parameters:
vertx- Vert.x instance to useconsumer- 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 nativeConsumer.- Parameters:
vertx- Vert.x instance to useconsumer- the Kafka consumer to wrapoptions- options used only for tracing settings- Returns:
- an instance of the KafkaConsumer
-
create
Create a new KafkaConsumer instance- Parameters:
vertx- Vert.x instance to useconfig- 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 useconfig- Kafka consumer configurationkeyType- class type for the key deserializationvalueType- 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 useoptions- 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 useoptions- Kafka consumer optionskeyType- class type for the key deserializationvalueType- class type for the value deserialization- Returns:
- an instance of the KafkaConsumer
-
exceptionHandler
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<K>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
handler
Description copied from interface:ReadStreamSet a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<K>- Returns:
- a reference to this, so the API can be used fluently
-
pause
Description copied from interface:ReadStreamPause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<K>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Description copied from interface:ReadStreamResume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<K>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Description copied from interface:ReadStreamFetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<K>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Description copied from interface:ReadStreamSet an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<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
- If the stream is in fetch mode, will return the current number of elements still to be delivered or 0 if paused.
Long.MAX_VALUE.- 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
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 therecord handler.- Parameters:
handler- handler called when batches of messages are fetched- Returns:
- current KafkaConsumer instance
-
pollTimeout
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
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<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 theKafkaConsumer. -
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 theKafkaConsumer. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
-
toBlockingIterable
-
toBlockingStream
-