简体   繁体   中英

How to bind Kafka consumer to Storm spout?

How to send Consumer record to Storm Spout object in one line code ? I have two instance one of them is KafkaConsumer object and other one is StormSpout object. I want to get nextTuple which came from Kafka Consumer poll to Spout using KafkaBolt object.

I think maybe your understanding is a little wrong. You're not supposed to create a KafkaConsumer manually.

Use the KafkaSpout (or Trident spout) from the org.apache.storm:storm-kafka-client module. You can find guides on how to use it in the Storm documentation at https://storm.apache.org/releases/2.0.0-SNAPSHOT/storm-kafka-client.html , and example code at https://github.com/apache/storm/tree/master/examples/storm-kafka-client-examples .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM