public final class KafkaConsumer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
KafkaConsumer.ConsumerBuilder |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
static KafkaConsumer.ConsumerBuilder |
newBuilder(String servers,
String groupId,
String clientId,
Collection<String> topics) |
void |
start(BatchConsumer<Message> messageProcessor) |
void |
start(Consumer<Message> messageProcessor) |
String |
toString() |
public static KafkaConsumer.ConsumerBuilder newBuilder(String servers, String groupId, String clientId, Collection<String> topics)
servers - One or more host port pairs separated by commas.groupId - Name of the group this consumer belongs to.clientId - Name of this consumer.topics - Names of the consumed topics.KafkaConsumer.ConsumerBuilderpublic void start(Consumer<Message> messageProcessor)
messageProcessor - The processor will process delivered messagepublic void start(BatchConsumer<Message> messageProcessor)
messageProcessor - The processor will process delivered messagepublic static void main(String[] args)
args - Input parametersCopyright © 2019. All rights reserved.