org.apache.ignite.stream.kafka

## Class KafkaStreamer<K,V>

- java.lang.Object
- - org.apache.ignite.stream.StreamAdapter<org.apache.kafka.clients.consumer.ConsumerRecord,K,V>
  - - org.apache.ignite.stream.kafka.KafkaStreamer<K,V>

-     public class KafkaStreamer<K,V>
      extends StreamAdapter<org.apache.kafka.clients.consumer.ConsumerRecord,K,V>

  Server that subscribes to topic messages from Kafka broker and streams its to key-value pairs into `IgniteDataStreamer` instance.

  Uses Kafka's High Level Consumer API to read messages from Kafka.

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.stream.StreamAdapter

      `ignite`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KafkaStreamer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setConsumerConfig(Properties consumerCfg)` Sets the consumer config.
    `void` | `setThreads(int threads)` Sets the threads.
    `void` | `setTimeout(long timeout)` Sets the polling timeout for Kafka tasks.
    `void` | `setTopic(List<String> topics)` Sets the topic names.
    `void` | `start()` Starts streamer.
    `void` | `stop()` Stops streamer.

    - ### Methods inherited from class org.apache.ignite.stream.StreamAdapter

      `addMessage, getIgnite, getMultipleTupleExtractor, getSingleTupleExtractor, getStreamer, getTupleExtractor, setIgnite, setMultipleTupleExtractor, setSingleTupleExtractor, setStreamer, setTupleExtractor`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KafkaStreamer

          public KafkaStreamer()

  - ### Method Detail

    - #### setTopic

          public void setTopic(List<String> topics)

      Sets the topic names.
      Parameters:
        `topics` - Topic names.

    - #### setThreads

          public void setThreads(int threads)

      Sets the threads.
      Parameters:
        `threads` - Number of threads.

    - #### setConsumerConfig

          public void setConsumerConfig(Properties consumerCfg)

      Sets the consumer config.
      Parameters:
        `consumerCfg` - Consumer configuration.

    - #### setTimeout

          public void setTimeout(long timeout)

      Sets the polling timeout for Kafka tasks.
      Parameters:
        `timeout` - Timeout.

    - #### start

          public void start()

      Starts streamer.
      Throws:
        `IgniteException` - If failed.

    - #### stop

          public void stop()

      Stops streamer.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020