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

NoSuchMethodError when creating ProducerRecord in upgrade system tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0, 1.1.0
    • None
    • None

    Description

      This patch https://github.com/apache/kafka/pull/4029 used a new constructor for ProducerRecord which doesn't exist in older clients. Hence system tests which use older clients fail with:

      Exception in thread "main" java.lang.NoSuchMethodError: org.apache.kafka.clients.producer.ProducerRecord.<init>(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Object;Ljava/lang/Object;)V
              at org.apache.kafka.tools.VerifiableProducer.send(VerifiableProducer.java:232)
              at org.apache.kafka.tools.VerifiableProducer.run(VerifiableProducer.java:462)
              at org.apache.kafka.tools.VerifiableProducer.main(VerifiableProducer.java:500)
      {"timestamp":1507711495458,"name":"shutdown_complete"}
      {"timestamp":1507711495459,"name":"tool_data","sent":0,"acked":0,"target_throughput":10000,"avg_throughput":0.0}
      amehta-macbook-pro:worker6 apurva$
      

      A trivial fix is to only use the new constructor if a message create time is explicitly passed to the VerifiableProducer, since older versions of the test would never use it.

      Attachments

        Issue Links

          Activity

            People

              apurva Apurva Mehta
              apurva Apurva Mehta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: