Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-17686

AsyncKafkaConsumer.offsetsForTimes() fails with NullPointerException

    XMLWordPrintableJSON

Details

    Description

      Error when running the integration test:

      Gradle Test Run :core:integrationTest > Gradle Test Executor 10 > PlaintextAdminIntegrationTest > testOffsetsForTimesAfterDeleteRecords(String) > "testOffsetsForTimesAfterDeleteRecords(String).quorum=kraft" FAILED
          java.lang.NullPointerException: Cannot invoke "org.apache.kafka.clients.consumer.internals.OffsetAndTimestampInternal.buildOffsetAndTimestamp()" because the return value of "java.util.Map$Entry.getValue()" is null
              at org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.lambda$offsetsForTimes$4(AsyncKafkaConsumer.java:1082)
              at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
              at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
              at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1858)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
              at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) 
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
              at org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.offsetsForTimes(AsyncKafkaConsumer.java:1080)
              at org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.offsetsForTimes(AsyncKafkaConsumer.java:1043)
              at org.apache.kafka.clients.consumer.KafkaConsumer.offsetsForTimes(KafkaConsumer.java:1560)
              at kafka.api.PlaintextAdminIntegrationTest.testOffsetsForTimesAfterDeleteRecords(PlaintextAdminIntegrationTest.scala:1535) 
      

      Attachments

        Issue Links

          Activity

            People

              kirktrue Kirk True
              kirktrue Kirk True
              Chia-Ping Tsai Chia-Ping Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: