Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14246 Update threading model for Consumer
  3. KAFKA-14848

KafkaConsumer incorrectly passes locally-scoped deserializers to FetchConfig

    XMLWordPrintableJSON

Details

    Description

      rayokota found some NullPointerExceptions that originate because of a recently introduced error in the KafkaConsumer constructor. The code was changed to pass the deserializer variables into the FetchConfig constructor. However, this code change incorrectly used the locally-scoped variables, not the instance-scoped variables. Since the locally-scoped variables could be null, this results in the FetchConfig storing null references, leading to downstream breakage.

      Suggested change:

      - FetchConfig<K, V> fetchConfig = new FetchConfig<>(config, keyDeserializer, valueDeserializer, isolationLevel);
      + FetchConfig<K, V> fetchConfig = new FetchConfig<>(config, this.keyDeserializer, this.valueDeserializer, isolationLevel);
      

      Attachments

        Issue Links

          Activity

            People

              kirktrue Kirk True
              kirktrue Kirk True
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified