quarks.samples.connectors.kafka

Class KafkaClient

  • java.lang.Object
    • quarks.samples.connectors.kafka.KafkaClient


  • public class KafkaClient
    extends java.lang.Object
    Demonstrate integrating with the Apache Kafka messaging system http://kafka.apache.org.

    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"
    • kafka topic "kafkaSampleTopic" exists

    See 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.
  • An application execution within your IDE once you set the class path to include the correct jars.
    • Constructor Summary

      Constructors 
      Constructor and Description
      KafkaClient() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KafkaClient

        public KafkaClient()
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception