public class KafkaClient
extends java.lang.Object
KafkaProducer is
a connector used to create a bridge between topology streams
and publishing to Kafka topics.
KafkaConsumer is
a connector used to create a bridge between topology streams
and subscribing to Kafka topics.
The client either publishes messages to a topic or subscribes to the topic and reports the messages received.
By default, a running Kafka cluster with the following characteristics is assumed:
bootstrap.servers="localhost:9092"zookeeper.connect="localhost:2181""kafkaSampleTopic" existsSee the Apache Kafka link above for information about setting up a Kafka cluster as well as creating a topic.
This may be executed from as:
java -cp samples/lib/quarks.samples.connectors.kafka.jar
quarks.samples.connectors.kafka.KafkaClient -h
- Run directly from the command line.
| Constructor and Description |
|---|
KafkaClient() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902