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

VerifiableProducer does not work properly with --message-create-time argument

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 2.1.0
    • Component/s: core
    • Labels:
      None

      Description

      If you run:

       

      ./bin/kafka-verifiable-producer.sh --broker-list <broker-list:9092> --topic test_topic_increasing_p2 --message-create-time <epoch argument> --acks -1 --max-messages 100

      the "<epoch argument>" for --message-create-time doesn't take a 13 digit long like 1529656934000. 

      The error message:

      verifiable-producer: error: argument --message-create-time: could not convert '1529656934000' to Integer (For input string: "1529656934000")

       

      When you provide a 10 digit (1529656934) epoch for the argument it does work but this leads to your topic being cleaned up in a few minutes since the retention time is expired.

       

      The error seems to be obvious since VerifiableProducer.java has:

              Long createTime = (long) res.getInt("createTime");

      when parsing the argument. This should be taken as a Long instead.

        Attachments

          Activity

            People

            • Assignee:
              tedyu Ted Yu
              Reporter:
              jasperknulst Jasper Knulst
              Reviewer:
              Guozhang Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: