我正在开发一个基于springboot和java8的kafka流应用程序。我们使用kafka客户机版本2.5.0我注意到,有时(并非总是)当从标点器转发记录时,操作失败,出现空指针异常。以下是堆栈跟踪:
Caused by: org.apache.kafka.streams.errors.StreamsException: task [2_2] Abort sending since an error caught with a previous record (timestamp 1603721062667) to topic reply-reminder-push-sender due to java.lang.NullPointerException\tat
org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:240)\tat
org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:111)\tat org.apache.kafka.streams.processor.internals.SinkNode.process(SinkNode.java:89)\tat
org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)\tat
org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)\tat
org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)\t... 24 common frames omitted
Caused by: java.lang.NullPointerException: null\tat
org.apache.kafka.common.record.DefaultRecord.sizeOf(DefaultRecord.java:613)\tat
org.apache.kafka.common.record.DefaultRecord.recordSizeUpperBound(DefaultRecord.java:633)\tat org.apache.kafka.common.record.DefaultRecordBatch.estimateBatchSizeUpperBound(DefaultRecordBatch.java:534)\tat
org.apache.kafka.common.record.AbstractRecords.estimateSizeInBytesUpperBound(AbstractRecords.java:135)\tat
org.apache.kafka.common.record.AbstractRecords.estimateSizeInBytesUpperBound(AbstractRecords.java:125)\tat org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:914)\tat
org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:862)\tat org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:181)\t... 29 common frames omitted
在计算记录头的大小时,库中似乎存在空指针异常,但我没有´我不认为我正在创建或更新它们。有什么办法解决吗?谢谢
暂无答案!
目前还没有任何答案,快来回答吧!