Spark流从Kafka接收byte []

时间:2019-02-22 08:20:24

标签: java apache-spark apache-kafka spark-streaming

我想集成Apache Kafka和Spark Streaming,我正在使用spark-streaming-kafka-0-8_2.11,我发现下面显示了此函数,但是Kafka中的值类型是字节数组。如何使用此功能从Kafka获取字节数组?

import org.apache.spark.streaming.kafka.*;

JavaPairInputDStream<String, String> directKafkaStream =
     KafkaUtils.createDirectStream(streamingContext,
         [key class], [value class], [key decoder class], [value decoder class],
         [map of Kafka parameters], [set of topics to consume]);

0 个答案:

没有答案