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

Console producer displays interactive prompt even when input is not interactive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.8.0
    • tools
    • None

    Description

      The prompt introduced in KAFKA-2955 may be indeed helpful when a user enters messages manually but when the messages are read from a file, it's not helpful and may be really annoying.

      Steps to reproduce
      1. Create a file with a decent number of messages (e.g. 80,000 in my case)
      2. Start console producer and forward the file contents to its STDIN:
      $ kafka-console-producer --broker-list b1,b2,b3 --topic test < messages.txt
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ... >>>>>>>>>>>>>>
      

      For each message the producer reads from the file, there's one > displayed polluting the output.

      Expected behavior:
      1. If the producer can detect that the input stream is a TTY, it should not display the prompt.
      2. Ideally, there should be a configuration parameter to disable this explicitly.

       

      Attachments

        Issue Links

          Activity

            People

              tombentley Tom Bentley
              morozov Sergei Morozov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: