public class KafkaSimpleConsumer extends Object
This class is not thread safe, the caller must ensure all the methods be called from single thread
| Modifier and Type | Class and Description |
|---|---|
static class |
KafkaSimpleConsumer.BytesMessageWithOffset |
| Modifier and Type | Field and Description |
|---|---|
static List<KafkaSimpleConsumer.BytesMessageWithOffset> |
EMPTY_MSGS |
| Constructor and Description |
|---|
KafkaSimpleConsumer(String topic,
int partitionId,
String clientId,
List<String> brokers,
boolean earliest) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<KafkaSimpleConsumer.BytesMessageWithOffset> |
fetch(long offset,
int timeoutMs) |
void |
stop() |
public static final List<KafkaSimpleConsumer.BytesMessageWithOffset> EMPTY_MSGS
public Iterable<KafkaSimpleConsumer.BytesMessageWithOffset> fetch(long offset, int timeoutMs) throws InterruptedException
InterruptedExceptionpublic void stop()
Copyright © 2011–2017. All rights reserved.