caused by: java.lang.assertionerror: assertion failed: ran out of Messages before reaching ending offset 264251742 for topic topic partition 1 start 264245135. this should not happen, and indicates that messages may have been lost At scala. Predef$.assert (predef.scala:179) at org.apache.spark.streaming.kafka.kafkardd$ Kafkardditerator.getnext (kafkardd.scala:165) At org.apache.spark.util.nextiterator.hasnext ( nextiterator.scala:71) at scala.collection.iterator$ $anon $11.hasnext (iterator.scala:327) at scala.collection.iterator$ $anon $14.hasnext (iterator.scala:388) at scala.collection.iterator$ $anon $11.hasnext (iterator.scala:327) at Org.apache.spark.util.collection.ExternalSorter.insertAll (externalsorter.scala:203) &NBSp At org.apache.spark.shuffle.sort.sortshufflewriter.write (sortshufflewriter.scala:73) at org.apache.spark.scheduler.shufflemaptask.runtask (shufflemaptask.scala:73) at Org.apache.spark.scheduler.ShuffleMapTask.runTask (shufflemaptask.scala:41) at Org.apache.spark.scheduler.Task.run (task.scala:88) at org.apache.spark.executor.executor$ Taskrunner.run (executor.scala:214)
The exception here is because the Kafka is reading the specified offset log (here is 264245135 to 264251742), because the log is too large, causing the total size of the log to exceed Fetch.message.max.bytesThe Set value (default is 1024*1024), which causes this error. The workaround is to increase the value of fetch.message.max.bytes in the parameters of the Kafka client.
For example://kafka configuration file val kafkaparams = map[string, String] ("Metadata.broker.list", Brokers, "fetch.message.max.bytes"- > "10485760")//Workflow Val messages = kafkautils.createdirectstream[string, String, Stringdecoder, Stringdecoder] (SSC, Kafkaparams, Topicsset)
Spark Streaming Integrated Kafak The problem of the RAN out of messages