/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.reactivex.kafka.client.consumer;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import io.vertx.kafka.client.consumer.OffsetAndMetadata;
import java.util.Set;
import io.vertx.kafka.client.common.PartitionInfo;
import io.vertx.kafka.client.common.TopicPartition;
import java.util.List;
import java.util.Map;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.kafka.client.consumer.OffsetAndTimestamp;
Vert.x Kafka consumer.
You receive Kafka records by providing a 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
and resume
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 RX-ified interface using Vert.x codegen. /**
* Vert.x Kafka consumer.
* <p>
* You receive Kafka records by providing a {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#handler}. As messages arrive the handler
* will be called with the records.
* <p>
* The {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause} and {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume} provides global control over reading the records from the consumer.
* <p>
* The {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause} and {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume} provides finer grained control over reading records
* for specific Topic/Partition, these are Kafka's specific operations.
*
* <p/>
* NOTE: This class has been automatically generated from the {@link io.vertx.kafka.client.consumer.KafkaConsumer original} non RX-ified interface using Vert.x codegen.
*/
@io.vertx.lang.rx.RxGen(io.vertx.kafka.client.consumer.KafkaConsumer.class)
public class KafkaConsumer<K,V> implements io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
KafkaConsumer that = (KafkaConsumer) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final io.vertx.lang.rx.TypeArg<KafkaConsumer> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new KafkaConsumer((io.vertx.kafka.client.consumer.KafkaConsumer) obj),
KafkaConsumer::getDelegate
);
private final io.vertx.kafka.client.consumer.KafkaConsumer<K,V> delegate;
public final io.vertx.lang.rx.TypeArg<K> __typeArg_0;
public final io.vertx.lang.rx.TypeArg<V> __typeArg_1;
public KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer delegate) {
this.delegate = delegate;
this.__typeArg_0 = io.vertx.lang.rx.TypeArg.unknown(); this.__typeArg_1 = io.vertx.lang.rx.TypeArg.unknown(); }
public KafkaConsumer(io.vertx.kafka.client.consumer.KafkaConsumer delegate, io.vertx.lang.rx.TypeArg<K> typeArg_0, io.vertx.lang.rx.TypeArg<V> typeArg_1) {
this.delegate = delegate;
this.__typeArg_0 = typeArg_0;
this.__typeArg_1 = typeArg_1;
}
public io.vertx.kafka.client.consumer.KafkaConsumer getDelegate() {
return delegate;
}
private io.reactivex.Observable<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> observable;
private io.reactivex.Flowable<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> flowable;
public synchronized io.reactivex.Observable<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> toObservable() {
if (observable == null) {
java.util.function.Function<io.vertx.kafka.client.consumer.KafkaConsumerRecord<K,V>, io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> conv = io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord::newInstance;
observable = io.vertx.reactivex.ObservableHelper.toObservable(delegate, conv);
}
return observable;
}
public synchronized io.reactivex.Flowable<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> toFlowable() {
if (flowable == null) {
java.util.function.Function<io.vertx.kafka.client.consumer.KafkaConsumerRecord<K,V>, io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> conv = io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord::newInstance;
flowable = io.vertx.reactivex.FlowableHelper.toFlowable(delegate, conv);
}
return flowable;
}
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.
Params: - amount –
Returns: a reference to this, so the API can be used fluently
/**
* Fetch the specified <code>amount</code> of elements. If the <code>ReadStream</code> has been paused, reading will
* recommence with the specified <code>amount</code> of items, otherwise the specified <code>amount</code> will
* be added to the current stream demand.
* @param amount
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> fetch(long amount) {
delegate.fetch(amount);
return this;
}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a WriteStream
.
Returns: a pipe
/**
* Pause this stream and return a to transfer the elements of this stream to a destination .
* <p/>
* The stream will be resumed when the pipe will be wired to a <code>WriteStream</code>.
* @return a pipe
*/
public io.vertx.reactivex.core.streams.Pipe<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> pipe() {
io.vertx.reactivex.core.streams.Pipe<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> ret = io.vertx.reactivex.core.streams.Pipe.newInstance(delegate.pipe(), (io.vertx.lang.rx.TypeArg)io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord.__TYPE_ARG);
return ret;
}
Like ReadStream.pipeTo
but with no completion handler. Params: - dst –
/**
* Like {@link io.vertx.reactivex.core.streams.ReadStream#pipeTo} but with no completion handler.
* @param dst
*/
public void pipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> dst) {
delegate.pipeTo(dst.getDelegate());
}
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Params: - dst – the destination write stream
- handler –
/**
* Pipe this <code>ReadStream</code> to the <code>WriteStream</code>.
* <p>
* Elements emitted by this stream will be written to the write stream until this stream ends or fails.
* <p>
* Once this stream has ended or failed, the write stream will be ended and the <code>handler</code> will be
* called with the result.
* @param dst the destination write stream
* @param handler
*/
public void pipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> dst, Handler<AsyncResult<Void>> handler) {
delegate.pipeTo(dst.getDelegate(), handler);
}
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Params: - dst – the destination write stream
Returns:
/**
* Pipe this <code>ReadStream</code> to the <code>WriteStream</code>.
* <p>
* Elements emitted by this stream will be written to the write stream until this stream ends or fails.
* <p>
* Once this stream has ended or failed, the write stream will be ended and the <code>handler</code> will be
* called with the result.
* @param dst the destination write stream
* @return
*/
public Completable rxPipeTo(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> dst) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
pipeTo(dst, handler);
});
}
Create a new KafkaConsumer instance
Params: - vertx – Vert.x instance to use
- config – Kafka consumer configuration
Returns: an instance of the KafkaConsumer
/**
* Create a new KafkaConsumer instance
* @param vertx Vert.x instance to use
* @param config Kafka consumer configuration
* @return an instance of the KafkaConsumer
*/
public static <K, V> io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> create(io.vertx.reactivex.core.Vertx vertx, Map<String, String> config) {
io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> ret = io.vertx.reactivex.kafka.client.consumer.KafkaConsumer.newInstance(io.vertx.kafka.client.consumer.KafkaConsumer.create(vertx.getDelegate(), config), io.vertx.lang.rx.TypeArg.unknown(), io.vertx.lang.rx.TypeArg.unknown());
return ret;
}
Create a new KafkaConsumer instance
Params: - 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 a new KafkaConsumer instance
* @param vertx Vert.x instance to use
* @param config Kafka consumer configuration
* @param keyType class type for the key deserialization
* @param valueType class type for the value deserialization
* @return an instance of the KafkaConsumer
*/
public static <K, V> io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> create(io.vertx.reactivex.core.Vertx vertx, Map<String, String> config, Class<K> keyType, Class<V> valueType) {
io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> ret = io.vertx.reactivex.kafka.client.consumer.KafkaConsumer.newInstance(io.vertx.kafka.client.consumer.KafkaConsumer.create(vertx.getDelegate(), config, io.vertx.lang.reactivex.Helper.unwrap(keyType), io.vertx.lang.reactivex.Helper.unwrap(valueType)), io.vertx.lang.rx.TypeArg.of(keyType), io.vertx.lang.rx.TypeArg.of(valueType));
return ret;
}
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> exceptionHandler(Handler<Throwable> handler) {
delegate.exceptionHandler(handler);
return this;
}
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> handler(Handler<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord<K, V>> handler) {
delegate.handler(new Handler<io.vertx.kafka.client.consumer.KafkaConsumerRecord<K,V>>() {
public void handle(io.vertx.kafka.client.consumer.KafkaConsumerRecord<K,V> event) {
handler.handle(io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecord.newInstance(event, __typeArg_0, __typeArg_1));
}
});
return this;
}
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pause() {
delegate.pause();
return this;
}
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> resume() {
delegate.resume();
return this;
}
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> endHandler(Handler<Void> endHandler) {
delegate.endHandler(endHandler);
return this;
}
Subscribe to the given topic to get dynamically assigned partitions.
Params: - topic – topic to subscribe to
Returns: current KafkaConsumer instance
/**
* Subscribe to the given topic to get dynamically assigned partitions.
* @param topic topic to subscribe to
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> subscribe(String topic) {
delegate.subscribe(topic);
return this;
}
Subscribe to the given list of topics to get dynamically assigned partitions.
Params: - topics – topics to subscribe to
Returns: current KafkaConsumer instance
/**
* Subscribe to the given list of topics to get dynamically assigned partitions.
* @param topics topics to subscribe to
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> subscribe(Set<String> topics) {
delegate.subscribe(topics);
return this;
}
Subscribe to the given topic to get dynamically assigned partitions.
Due to internal buffering of messages, when changing the subscribed topic
the old topic may remain in effect
(as observed by the record handler})
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new topic.
Params: - topic – topic to subscribe to
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Subscribe to the given topic to get dynamically assigned partitions.
* <p>
* Due to internal buffering of messages, when changing the subscribed topic
* the old topic may remain in effect
* (as observed by the record handler})
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new topic.
* @param topic topic to subscribe to
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> subscribe(String topic, Handler<AsyncResult<Void>> completionHandler) {
delegate.subscribe(topic, completionHandler);
return this;
}
Subscribe to the given topic to get dynamically assigned partitions.
Due to internal buffering of messages, when changing the subscribed topic
the old topic may remain in effect
(as observed by the record handler})
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new topic.
Params: - topic – topic to subscribe to
Returns: current KafkaConsumer instance
/**
* Subscribe to the given topic to get dynamically assigned partitions.
* <p>
* Due to internal buffering of messages, when changing the subscribed topic
* the old topic may remain in effect
* (as observed by the record handler})
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new topic.
* @param topic topic to subscribe to
* @return current KafkaConsumer instance
*/
public Completable rxSubscribe(String topic) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
subscribe(topic, handler);
});
}
Subscribe to the given list of topics to get dynamically assigned partitions.
Due to internal buffering of messages, when changing the subscribed topics
the old set of topics may remain in effect
(as observed by the record handler})
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new set of topics.
Params: - topics – topics to subscribe to
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Subscribe to the given list of topics to get dynamically assigned partitions.
* <p>
* Due to internal buffering of messages, when changing the subscribed topics
* the old set of topics may remain in effect
* (as observed by the record handler})
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new set of topics.
* @param topics topics to subscribe to
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> subscribe(Set<String> topics, Handler<AsyncResult<Void>> completionHandler) {
delegate.subscribe(topics, completionHandler);
return this;
}
Subscribe to the given list of topics to get dynamically assigned partitions.
Due to internal buffering of messages, when changing the subscribed topics
the old set of topics may remain in effect
(as observed by the record handler})
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new set of topics.
Params: - topics – topics to subscribe to
Returns: current KafkaConsumer instance
/**
* Subscribe to the given list of topics to get dynamically assigned partitions.
* <p>
* Due to internal buffering of messages, when changing the subscribed topics
* the old set of topics may remain in effect
* (as observed by the record handler})
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new set of topics.
* @param topics topics to subscribe to
* @return current KafkaConsumer instance
*/
public Completable rxSubscribe(Set<String> topics) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
subscribe(topics, handler);
});
}
Manually assign a partition to this consumer.
Params: - topicPartition – partition which want assigned
Returns: current KafkaConsumer instance
/**
* Manually assign a partition to this consumer.
* @param topicPartition partition which want assigned
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> assign(TopicPartition topicPartition) {
delegate.assign(topicPartition);
return this;
}
Manually assign a list of partition to this consumer.
Params: - topicPartitions – partitions which want assigned
Returns: current KafkaConsumer instance
/**
* Manually assign a list of partition to this consumer.
* @param topicPartitions partitions which want assigned
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> assign(Set<TopicPartition> topicPartitions) {
delegate.assign(topicPartitions);
return this;
}
Manually assign a partition to this consumer.
Due to internal buffering of messages, when reassigning
the old partition may remain in effect
(as observed by the record handler)}
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new partition.
Params: - topicPartition – partition which want assigned
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Manually assign a partition to this consumer.
* <p>
* Due to internal buffering of messages, when reassigning
* the old partition may remain in effect
* (as observed by the record handler)}
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new partition.
* @param topicPartition partition which want assigned
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> assign(TopicPartition topicPartition, Handler<AsyncResult<Void>> completionHandler) {
delegate.assign(topicPartition, completionHandler);
return this;
}
Manually assign a partition to this consumer.
Due to internal buffering of messages, when reassigning
the old partition may remain in effect
(as observed by the record handler)}
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new partition.
Params: - topicPartition – partition which want assigned
Returns: current KafkaConsumer instance
/**
* Manually assign a partition to this consumer.
* <p>
* Due to internal buffering of messages, when reassigning
* the old partition may remain in effect
* (as observed by the record handler)}
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new partition.
* @param topicPartition partition which want assigned
* @return current KafkaConsumer instance
*/
public Completable rxAssign(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
assign(topicPartition, handler);
});
}
Manually assign a list of partition to this consumer.
Due to internal buffering of messages, when reassigning
the old set of partitions may remain in effect
(as observed by the record handler)}
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new set of partitions.
Params: - topicPartitions – partitions which want assigned
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Manually assign a list of partition to this consumer.
* <p>
* Due to internal buffering of messages, when reassigning
* the old set of partitions may remain in effect
* (as observed by the record handler)}
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new set of partitions.
* @param topicPartitions partitions which want assigned
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> assign(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler) {
delegate.assign(topicPartitions, completionHandler);
return this;
}
Manually assign a list of partition to this consumer.
Due to internal buffering of messages, when reassigning
the old set of partitions may remain in effect
(as observed by the record handler)}
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new set of partitions.
Params: - topicPartitions – partitions which want assigned
Returns: current KafkaConsumer instance
/**
* Manually assign a list of partition to this consumer.
* <p>
* Due to internal buffering of messages, when reassigning
* the old set of partitions may remain in effect
* (as observed by the record handler)}
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new set of partitions.
* @param topicPartitions partitions which want assigned
* @return current KafkaConsumer instance
*/
public Completable rxAssign(Set<TopicPartition> topicPartitions) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
assign(topicPartitions, handler);
});
}
Get the set of partitions currently assigned to this consumer.
Params: - handler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Get the set of partitions currently assigned to this consumer.
* @param handler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> assignment(Handler<AsyncResult<Set<TopicPartition>>> handler) {
delegate.assignment(handler);
return this;
}
Get the set of partitions currently assigned to this consumer.
Returns: current KafkaConsumer instance
/**
* Get the set of partitions currently assigned to this consumer.
* @return current KafkaConsumer instance
*/
public Single<Set<TopicPartition>> rxAssignment() {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
assignment(handler);
});
}
Unsubscribe from topics currently subscribed with subscribe.
Returns: current KafkaConsumer instance
/**
* Unsubscribe from topics currently subscribed with subscribe.
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> unsubscribe() {
delegate.unsubscribe();
return this;
}
Unsubscribe from topics currently subscribed with subscribe.
Params: - completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Unsubscribe from topics currently subscribed with subscribe.
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> unsubscribe(Handler<AsyncResult<Void>> completionHandler) {
delegate.unsubscribe(completionHandler);
return this;
}
Unsubscribe from topics currently subscribed with subscribe.
Returns: current KafkaConsumer instance
/**
* Unsubscribe from topics currently subscribed with subscribe.
* @return current KafkaConsumer instance
*/
public Completable rxUnsubscribe() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
unsubscribe(handler);
});
}
Get the current subscription.
Params: - handler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Get the current subscription.
* @param handler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> subscription(Handler<AsyncResult<Set<String>>> handler) {
delegate.subscription(handler);
return this;
}
Get the current subscription.
Returns: current KafkaConsumer instance
/**
* Get the current subscription.
* @return current KafkaConsumer instance
*/
public Single<Set<String>> rxSubscription() {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
subscription(handler);
});
}
Suspend fetching from the requested partition.
Params: - topicPartition – topic partition from which suspend fetching
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partition.
* @param topicPartition topic partition from which suspend fetching
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pause(TopicPartition topicPartition) {
delegate.pause(topicPartition);
return this;
}
Suspend fetching from the requested partitions.
Params: - topicPartitions – topic partition from which suspend fetching
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partitions.
* @param topicPartitions topic partition from which suspend fetching
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pause(Set<TopicPartition> topicPartitions) {
delegate.pause(topicPartitions);
return this;
}
Suspend fetching from the requested partition.
Due to internal buffering of messages,
the will
continue to observe messages from the given topicPartition
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will not see messages from the given topicPartition
.
Params: - topicPartition – topic partition from which suspend fetching
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages from the given <code>topicPartition</code>
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will not see messages
* from the given <code>topicPartition</code>.
* @param topicPartition topic partition from which suspend fetching
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pause(TopicPartition topicPartition, Handler<AsyncResult<Void>> completionHandler) {
delegate.pause(topicPartition, completionHandler);
return this;
}
Suspend fetching from the requested partition.
Due to internal buffering of messages,
the will
continue to observe messages from the given topicPartition
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will not see messages from the given topicPartition
.
Params: - topicPartition – topic partition from which suspend fetching
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages from the given <code>topicPartition</code>
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will not see messages
* from the given <code>topicPartition</code>.
* @param topicPartition topic partition from which suspend fetching
* @return current KafkaConsumer instance
*/
public Completable rxPause(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
pause(topicPartition, handler);
});
}
Suspend fetching from the requested partitions.
Due to internal buffering of messages,
the will
continue to observe messages from the given topicPartitions
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will not see messages from the given topicPartitions
.
Params: - topicPartitions – topic partition from which suspend fetching
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages from the given <code>topicPartitions</code>
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will not see messages
* from the given <code>topicPartitions</code>.
* @param topicPartitions topic partition from which suspend fetching
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pause(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler) {
delegate.pause(topicPartitions, completionHandler);
return this;
}
Suspend fetching from the requested partitions.
Due to internal buffering of messages,
the will
continue to observe messages from the given topicPartitions
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will not see messages from the given topicPartitions
.
Params: - topicPartitions – topic partition from which suspend fetching
Returns: current KafkaConsumer instance
/**
* Suspend fetching from the requested partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages from the given <code>topicPartitions</code>
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will not see messages
* from the given <code>topicPartitions</code>.
* @param topicPartitions topic partition from which suspend fetching
* @return current KafkaConsumer instance
*/
public Completable rxPause(Set<TopicPartition> topicPartitions) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
pause(topicPartitions, handler);
});
}
Get the set of partitions that were previously paused by a call to pause(Set).
Params: - handler – handler called on operation completed
/**
* Get the set of partitions that were previously paused by a call to pause(Set).
* @param handler handler called on operation completed
*/
public void paused(Handler<AsyncResult<Set<TopicPartition>>> handler) {
delegate.paused(handler);
}
Get the set of partitions that were previously paused by a call to pause(Set).
Returns:
/**
* Get the set of partitions that were previously paused by a call to pause(Set).
* @return
*/
public Single<Set<TopicPartition>> rxPaused() {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
paused(handler);
});
}
Resume specified partition which have been paused with pause.
Params: - topicPartition – topic partition from which resume fetching
Returns: current KafkaConsumer instance
/**
* Resume specified partition which have been paused with pause.
* @param topicPartition topic partition from which resume fetching
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> resume(TopicPartition topicPartition) {
delegate.resume(topicPartition);
return this;
}
Resume specified partitions which have been paused with pause.
Params: - topicPartitions – topic partition from which resume fetching
Returns: current KafkaConsumer instance
/**
* Resume specified partitions which have been paused with pause.
* @param topicPartitions topic partition from which resume fetching
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> resume(Set<TopicPartition> topicPartitions) {
delegate.resume(topicPartitions);
return this;
}
Resume specified partition which have been paused with pause.
Params: - topicPartition – topic partition from which resume fetching
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Resume specified partition which have been paused with pause.
* @param topicPartition topic partition from which resume fetching
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> resume(TopicPartition topicPartition, Handler<AsyncResult<Void>> completionHandler) {
delegate.resume(topicPartition, completionHandler);
return this;
}
Resume specified partition which have been paused with pause.
Params: - topicPartition – topic partition from which resume fetching
Returns: current KafkaConsumer instance
/**
* Resume specified partition which have been paused with pause.
* @param topicPartition topic partition from which resume fetching
* @return current KafkaConsumer instance
*/
public Completable rxResume(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
resume(topicPartition, handler);
});
}
Resume specified partitions which have been paused with pause.
Params: - topicPartitions – topic partition from which resume fetching
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Resume specified partitions which have been paused with pause.
* @param topicPartitions topic partition from which resume fetching
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> resume(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler) {
delegate.resume(topicPartitions, completionHandler);
return this;
}
Resume specified partitions which have been paused with pause.
Params: - topicPartitions – topic partition from which resume fetching
Returns: current KafkaConsumer instance
/**
* Resume specified partitions which have been paused with pause.
* @param topicPartitions topic partition from which resume fetching
* @return current KafkaConsumer instance
*/
public Completable rxResume(Set<TopicPartition> topicPartitions) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
resume(topicPartitions, handler);
});
}
Set the handler called when topic partitions are revoked to the consumer
Params: - handler – handler called on revoked topic partitions
Returns: current KafkaConsumer instance
/**
* Set the handler called when topic partitions are revoked to the consumer
* @param handler handler called on revoked topic partitions
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> partitionsRevokedHandler(Handler<Set<TopicPartition>> handler) {
delegate.partitionsRevokedHandler(handler);
return this;
}
Set the handler called when topic partitions are assigned to the consumer
Params: - handler – handler called on assigned topic partitions
Returns: current KafkaConsumer instance
/**
* Set the handler called when topic partitions are assigned to the consumer
* @param handler handler called on assigned topic partitions
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> partitionsAssignedHandler(Handler<Set<TopicPartition>> handler) {
delegate.partitionsAssignedHandler(handler);
return this;
}
Overrides the fetch offsets that the consumer will use on the next poll.
Params: - topicPartition – topic partition for which seek
- offset – offset to seek inside the topic partition
Returns: current KafkaConsumer instance
/**
* Overrides the fetch offsets that the consumer will use on the next poll.
* @param topicPartition topic partition for which seek
* @param offset offset to seek inside the topic partition
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seek(TopicPartition topicPartition, long offset) {
delegate.seek(topicPartition, offset);
return this;
}
Overrides the fetch offsets that the consumer will use on the next poll.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
- offset – offset to seek inside the topic partition
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Overrides the fetch offsets that the consumer will use on the next poll.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @param offset offset to seek inside the topic partition
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seek(TopicPartition topicPartition, long offset, Handler<AsyncResult<Void>> completionHandler) {
delegate.seek(topicPartition, offset, completionHandler);
return this;
}
Overrides the fetch offsets that the consumer will use on the next poll.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
- offset – offset to seek inside the topic partition
Returns: current KafkaConsumer instance
/**
* Overrides the fetch offsets that the consumer will use on the next poll.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @param offset offset to seek inside the topic partition
* @return current KafkaConsumer instance
*/
public Completable rxSeek(TopicPartition topicPartition, long offset) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
seek(topicPartition, offset, handler);
});
}
Seek to the first offset for each of the given partition.
Params: - topicPartition – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partition.
* @param topicPartition topic partition for which seek
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToBeginning(TopicPartition topicPartition) {
delegate.seekToBeginning(topicPartition);
return this;
}
Seek to the first offset for each of the given partitions.
Params: - topicPartitions – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partitions.
* @param topicPartitions topic partition for which seek
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToBeginning(Set<TopicPartition> topicPartitions) {
delegate.seekToBeginning(topicPartitions);
return this;
}
Seek to the first offset for each of the given partition.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToBeginning(TopicPartition topicPartition, Handler<AsyncResult<Void>> completionHandler) {
delegate.seekToBeginning(topicPartition, completionHandler);
return this;
}
Seek to the first offset for each of the given partition.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @return current KafkaConsumer instance
*/
public Completable rxSeekToBeginning(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
seekToBeginning(topicPartition, handler);
});
}
Seek to the first offset for each of the given partitions.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartitions – topic partition for which seek
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartitions topic partition for which seek
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToBeginning(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler) {
delegate.seekToBeginning(topicPartitions, completionHandler);
return this;
}
Seek to the first offset for each of the given partitions.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartitions – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the first offset for each of the given partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartitions topic partition for which seek
* @return current KafkaConsumer instance
*/
public Completable rxSeekToBeginning(Set<TopicPartition> topicPartitions) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
seekToBeginning(topicPartitions, handler);
});
}
Seek to the last offset for each of the given partition.
Params: - topicPartition – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partition.
* @param topicPartition topic partition for which seek
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToEnd(TopicPartition topicPartition) {
delegate.seekToEnd(topicPartition);
return this;
}
Seek to the last offset for each of the given partitions.
Params: - topicPartitions – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partitions.
* @param topicPartitions topic partition for which seek
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToEnd(Set<TopicPartition> topicPartitions) {
delegate.seekToEnd(topicPartitions);
return this;
}
Seek to the last offset for each of the given partition.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToEnd(TopicPartition topicPartition, Handler<AsyncResult<Void>> completionHandler) {
delegate.seekToEnd(topicPartition, completionHandler);
return this;
}
Seek to the last offset for each of the given partition.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartition – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partition.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartition topic partition for which seek
* @return current KafkaConsumer instance
*/
public Completable rxSeekToEnd(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
seekToEnd(topicPartition, handler);
});
}
Seek to the last offset for each of the given partitions.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartitions – topic partition for which seek
- completionHandler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartitions topic partition for which seek
* @param completionHandler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> seekToEnd(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler) {
delegate.seekToEnd(topicPartitions, completionHandler);
return this;
}
Seek to the last offset for each of the given partitions.
Due to internal buffering of messages,
the will
continue to observe messages fetched with respect to the old offset
until some time after the given completionHandler
is called. In contrast, the once the given completionHandler
is called the batchHandler
will only see messages consistent with the new offset.
Params: - topicPartitions – topic partition for which seek
Returns: current KafkaConsumer instance
/**
* Seek to the last offset for each of the given partitions.
* <p>
* Due to internal buffering of messages,
* the will
* continue to observe messages fetched with respect to the old offset
* until some time <em>after</em> the given <code>completionHandler</code>
* is called. In contrast, the once the given <code>completionHandler</code>
* is called the {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#batchHandler} will only see messages
* consistent with the new offset.
* @param topicPartitions topic partition for which seek
* @return current KafkaConsumer instance
*/
public Completable rxSeekToEnd(Set<TopicPartition> topicPartitions) {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
seekToEnd(topicPartitions, handler);
});
}
Commit current offsets for all the subscribed list of topics and partition.
/**
* Commit current offsets for all the subscribed list of topics and partition.
*/
public void commit() {
delegate.commit();
}
Commit current offsets for all the subscribed list of topics and partition.
Params: - completionHandler – handler called on operation completed
/**
* Commit current offsets for all the subscribed list of topics and partition.
* @param completionHandler handler called on operation completed
*/
public void commit(Handler<AsyncResult<Void>> completionHandler) {
delegate.commit(completionHandler);
}
Commit current offsets for all the subscribed list of topics and partition.
Returns:
/**
* Commit current offsets for all the subscribed list of topics and partition.
* @return
*/
public Completable rxCommit() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
commit(handler);
});
}
Get the last committed offset for the given partition (whether the commit happened by this process or another).
Params: - topicPartition – topic partition for getting last committed offset
- handler – handler called on operation completed
/**
* Get the last committed offset for the given partition (whether the commit happened by this process or another).
* @param topicPartition topic partition for getting last committed offset
* @param handler handler called on operation completed
*/
public void committed(TopicPartition topicPartition, Handler<AsyncResult<OffsetAndMetadata>> handler) {
delegate.committed(topicPartition, handler);
}
Get the last committed offset for the given partition (whether the commit happened by this process or another).
Params: - topicPartition – topic partition for getting last committed offset
Returns:
/**
* Get the last committed offset for the given partition (whether the commit happened by this process or another).
* @param topicPartition topic partition for getting last committed offset
* @return
*/
public Single<OffsetAndMetadata> rxCommitted(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
committed(topicPartition, handler);
});
}
Get metadata about the partitions for a given topic.
Params: - topic – topic partition for which getting partitions info
- handler – handler called on operation completed
Returns: current KafkaConsumer instance
/**
* Get metadata about the partitions for a given topic.
* @param topic topic partition for which getting partitions info
* @param handler handler called on operation completed
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> partitionsFor(String topic, Handler<AsyncResult<List<PartitionInfo>>> handler) {
delegate.partitionsFor(topic, handler);
return this;
}
Get metadata about the partitions for a given topic.
Params: - topic – topic partition for which getting partitions info
Returns: current KafkaConsumer instance
/**
* Get metadata about the partitions for a given topic.
* @param topic topic partition for which getting partitions info
* @return current KafkaConsumer instance
*/
public Single<List<PartitionInfo>> rxPartitionsFor(String topic) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
partitionsFor(topic, 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
. Params: - handler – handler called when batches of messages are fetched
Returns: current KafkaConsumer instance
/**
* 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 {@link io.vertx.reactivex.kafka.client.consumer.KafkaConsumer #handler(Handler) record handler}.
* @param handler handler called when batches of messages are fetched
* @return current KafkaConsumer instance
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> batchHandler(Handler<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecords<K, V>> handler) {
delegate.batchHandler(new Handler<io.vertx.kafka.client.consumer.KafkaConsumerRecords<K,V>>() {
public void handle(io.vertx.kafka.client.consumer.KafkaConsumerRecords<K,V> event) {
handler.handle(io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecords.newInstance(event, __typeArg_0, __typeArg_1));
}
});
return this;
}
Close the consumer
/**
* Close the consumer
*/
public void close() {
delegate.close();
}
Close the consumer
Params: - completionHandler – handler called on operation completed
/**
* Close the consumer
* @param completionHandler handler called on operation completed
*/
public void close(Handler<AsyncResult<Void>> completionHandler) {
delegate.close(completionHandler);
}
Close the consumer
Returns:
/**
* Close the consumer
* @return
*/
public Completable rxClose() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
close(handler);
});
}
Get the offset of the next record that will be fetched (if a record with that offset exists).
Params: - partition – The partition to get the position for
- handler – handler called on operation completed
/**
* Get the offset of the next record that will be fetched (if a record with that offset exists).
* @param partition The partition to get the position for
* @param handler handler called on operation completed
*/
public void position(TopicPartition partition, Handler<AsyncResult<Long>> handler) {
delegate.position(partition, handler);
}
Get the offset of the next record that will be fetched (if a record with that offset exists).
Params: - partition – The partition to get the position for
Returns:
/**
* Get the offset of the next record that will be fetched (if a record with that offset exists).
* @param partition The partition to get the position for
* @return
*/
public Single<Long> rxPosition(TopicPartition partition) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
position(partition, handler);
});
}
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
Params: - topicPartition – TopicPartition to query.
- timestamp – Timestamp to be used in the query.
- handler – handler called on operation completed
/**
* Look up the offset for the given partition by timestamp. Note: the result might be null in case
* for the given timestamp no offset can be found -- e.g., when the timestamp refers to the future
* @param topicPartition TopicPartition to query.
* @param timestamp Timestamp to be used in the query.
* @param handler handler called on operation completed
*/
public void offsetsForTimes(TopicPartition topicPartition, Long timestamp, Handler<AsyncResult<OffsetAndTimestamp>> handler) {
delegate.offsetsForTimes(topicPartition, timestamp, handler);
}
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
Params: - topicPartition – TopicPartition to query.
- timestamp – Timestamp to be used in the query.
Returns:
/**
* Look up the offset for the given partition by timestamp. Note: the result might be null in case
* for the given timestamp no offset can be found -- e.g., when the timestamp refers to the future
* @param topicPartition TopicPartition to query.
* @param timestamp Timestamp to be used in the query.
* @return
*/
public Single<OffsetAndTimestamp> rxOffsetsForTimes(TopicPartition topicPartition, Long timestamp) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
offsetsForTimes(topicPartition, timestamp, handler);
});
}
Get the first offset for the given partitions.
Params: - topicPartition – the partition to get the earliest offset.
- handler – handler called on operation completed. Returns the earliest available offset for the given partition
/**
* Get the first offset for the given partitions.
* @param topicPartition the partition to get the earliest offset.
* @param handler handler called on operation completed. Returns the earliest available offset for the given partition
*/
public void beginningOffsets(TopicPartition topicPartition, Handler<AsyncResult<Long>> handler) {
delegate.beginningOffsets(topicPartition, handler);
}
Get the first offset for the given partitions.
Params: - topicPartition – the partition to get the earliest offset.
Returns:
/**
* Get the first offset for the given partitions.
* @param topicPartition the partition to get the earliest offset.
* @return
*/
public Single<Long> rxBeginningOffsets(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
beginningOffsets(topicPartition, handler);
});
}
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.
Params: - topicPartition – the partition to get the end offset.
- handler – handler called on operation completed. The end offset for the given partition.
/**
* Get the last offset for the given partition. The last offset of a partition is the offset
* of the upcoming message, i.e. the offset of the last available message + 1.
* @param topicPartition the partition to get the end offset.
* @param handler handler called on operation completed. The end offset for the given partition.
*/
public void endOffsets(TopicPartition topicPartition, Handler<AsyncResult<Long>> handler) {
delegate.endOffsets(topicPartition, handler);
}
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.
Params: - topicPartition – the partition to get the end offset.
Returns:
/**
* Get the last offset for the given partition. The last offset of a partition is the offset
* of the upcoming message, i.e. the offset of the last available message + 1.
* @param topicPartition the partition to get the end offset.
* @return
*/
public Single<Long> rxEndOffsets(TopicPartition topicPartition) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
endOffsets(topicPartition, handler);
});
}
Sets the poll timeout (in ms) for the underlying native Kafka Consumer. Defaults to 1000.
Setting timeout to a lower value results in a more 'responsive' client, because it will block for a shorter period
if no data is available in the assigned partition and therefore allows subsequent actions to be executed with a shorter
delay. At the same time, the client will poll more frequently and thus will potentially create a higher load on the Kafka Broker.
Params: - timeout – The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
Returns:
/**
* Sets the poll timeout (in ms) for the underlying native Kafka Consumer. Defaults to 1000.
* Setting timeout to a lower value results in a more 'responsive' client, because it will block for a shorter period
* if no data is available in the assigned partition and therefore allows subsequent actions to be executed with a shorter
* delay. At the same time, the client will poll more frequently and thus will potentially create a higher load on the Kafka Broker.
* @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
* @return
*/
public io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> pollTimeout(long timeout) {
io.vertx.reactivex.kafka.client.consumer.KafkaConsumer<K, V> ret = io.vertx.reactivex.kafka.client.consumer.KafkaConsumer.newInstance(delegate.pollTimeout(timeout), __typeArg_0, __typeArg_1);
return ret;
}
Executes a poll for getting messages from Kafka
Params: - timeout – The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
- handler – handler called after the poll with batch of records (can be empty).
/**
* Executes a poll for getting messages from Kafka
* @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
* @param handler handler called after the poll with batch of records (can be empty).
*/
public void poll(long timeout, Handler<AsyncResult<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecords<K, V>>> handler) {
delegate.poll(timeout, new Handler<AsyncResult<io.vertx.kafka.client.consumer.KafkaConsumerRecords<K,V>>>() {
public void handle(AsyncResult<io.vertx.kafka.client.consumer.KafkaConsumerRecords<K,V>> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecords.newInstance(ar.result(), __typeArg_0, __typeArg_1)));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
}
Executes a poll for getting messages from Kafka
Params: - timeout – The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
Returns:
/**
* Executes a poll for getting messages from Kafka
* @param timeout The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.
* @return
*/
public Single<io.vertx.reactivex.kafka.client.consumer.KafkaConsumerRecords<K, V>> rxPoll(long timeout) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
poll(timeout, handler);
});
}
public static <K,V>KafkaConsumer<K,V> newInstance(io.vertx.kafka.client.consumer.KafkaConsumer arg) {
return arg != null ? new KafkaConsumer<K,V>(arg) : null;
}
public static <K,V>KafkaConsumer<K,V> newInstance(io.vertx.kafka.client.consumer.KafkaConsumer arg, io.vertx.lang.rx.TypeArg<K> __typeArg_K, io.vertx.lang.rx.TypeArg<V> __typeArg_V) {
return arg != null ? new KafkaConsumer<K,V>(arg, __typeArg_K, __typeArg_V) : null;
}
}