OK
Getting Null pointer exception while replying WAL! One possible reason is
that the messages RDD might contain null elements, and attempting to read
JSON from null values can result in an NPE. To handle this, you can add a
filter before processing the RDD to remove null elements.
msgs.foreachRD
Please find below code
def main(args: Array[String]): Unit = {
val config: Config = ConfigFactory.load()
val streamC = StreamingContext.getOrCreate(
checkpointDirectory,
() => functionToCreateContext(config, checkpointDirectory)
)
streamC.start()
streamC.awaitTerm