The code is similar to :
val df = spark
while I am writing in Java.
However, I keep throwing the following warning:
CachedKafkaConsumer: CachedKafkaConsumer is not running in UninterruptibleThread. It may hang when CachedKafkaConsumer's method are interrupted because of KAFKA-1894.
How to solve it? Thanks!