I want to read from many topics in Kafka and know from where each message is coming (topic1, topic2 and so on).
val kafkaParams = Map[String, String]("metadata.broker.list" -> "myKafka:9092") val topics = Set("EntryLog", "presOpManager") val directKafkaStream = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](ssc, kafkaParams, topics) Is there some way to separate the messages for topics with just one directStream? or should I create different streamings for each topic?