Kafka Spark Stream save directly to Redis

898 views Asked by At

I'am using Scala to get kafkaStream and want to insert this data directly to Redis. What is the best optimum strategy to do so ?

val kafkaStream = KafkaUtils.createStream(ssc, "192.168.0.40:2181", "group", topics, StorageLevel.MEMORY_AND_DISK)

Earlier I was trying to use https://github.com/debasishg/scala-redis but this does not work with Spark so i had to collect the RDD and then save the record into Redis which is creating lot of overhead in my project. So looking for some solution where I can directly push this string of messages into Redis and also want to maintain the ZScore.

Thanks,

0

There are 0 answers