K - the type of keyV - the type of valuepublic static interface KafkaCluster.InteractiveConsumer<K,V> extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Asynchronously close this consumer's connection to Kafka and begin to clean up all resources.
|
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> |
nextRecord()
Block until a record can be read from this consumer's topic, and return the record.
|
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> |
nextRecord(long timeout,
TimeUnit unit)
Block until a record can be read from this consumer's topic or until the timeout occurs, and if a record was read
return the record.
|
default V |
nextValue()
Block until a record can be read from this consumer's topic, and return the value in that record.
|
default V |
nextValue(long timeout,
TimeUnit unit)
Block until a record can be read from this consumer's topic or until the timeout occurs, and if a record was read
return the value in that record.
|
Stream<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> |
stream()
Obtain a stream to consume the input messages.
|
Stream<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> |
streamAll()
Obtain a stream over all of accumulated input messages.
|
default V nextValue() throws InterruptedException
InterruptedException - if the thread is interrupted while blockingorg.apache.kafka.clients.consumer.ConsumerRecord<K,V> nextRecord() throws InterruptedException
InterruptedException - if the thread is interrupted while blockingdefault V nextValue(long timeout, TimeUnit unit) throws InterruptedException
timeout - the maximum amount of time to block to wait for a recordunit - the unit of time for the timeoutInterruptedException - if the thread is interrupted while blockingorg.apache.kafka.clients.consumer.ConsumerRecord<K,V> nextRecord(long timeout, TimeUnit unit) throws InterruptedException
timeout - the maximum amount of time to block to wait for a recordunit - the unit of time for the timeoutInterruptedException - if the thread is interrupted while blockingStream<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> stream()
next...() methods.Stream<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> streamAll()
stream(), nextRecord(), nextRecord(long, TimeUnit), nextValue()
and nextValue(long, TimeUnit) methods.void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2017 JBoss by Red Hat. All rights reserved.