public class QueuedKafkaConsumer<K,V> extends Object implements AutoCloseable
| Constructor and Description |
|---|
QueuedKafkaConsumer(org.apache.kafka.common.TopicPartition topicPartition,
Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isEmpty() |
boolean |
isEmpty(long waitMillis) |
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> |
poll()
Poll a single record, waiting for up to one second for it to be available.
|
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> |
poll(long timeoutMillis)
Poll a single record, waiting for up to the given number of milliseconds for it to be available.
|
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> |
poll(long timeout,
TimeUnit unit)
Poll a single record, waiting for up to the given time/timeUnit for it to be available.
|
void |
seekToBeginning()
Seek to beginning of topic partition
|
void |
seekToEnd()
Seek to end of topic partition
|
public QueuedKafkaConsumer(org.apache.kafka.common.TopicPartition topicPartition,
Properties properties)
public void seekToBeginning()
public void seekToEnd()
public org.apache.kafka.clients.consumer.ConsumerRecord<K,V> poll()
public org.apache.kafka.clients.consumer.ConsumerRecord<K,V> poll(long timeoutMillis)
timeoutMillis - The timeout in millisecondspublic org.apache.kafka.clients.consumer.ConsumerRecord<K,V> poll(long timeout, TimeUnit unit)
timeout - The timeout valueunit - The unit of the timeoutpublic boolean isEmpty()
public boolean isEmpty(long waitMillis)
public void close()
close in interface AutoCloseableCopyright © 2019. All rights reserved.