James Cheng created KAFKA-3945:
----------------------------------

             Summary: kafka-console-producer.sh does not accept 
request-required-acks=all
                 Key: KAFKA-3945
                 URL: https://issues.apache.org/jira/browse/KAFKA-3945
             Project: Kafka
          Issue Type: Bug
            Reporter: James Cheng


The Java producer accepts 0, 1, -1, and all as valid values for acks. The 
kafka-console-producer.sh however does not accept "all" as a valid value.

{code}
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test 
--request-required-acks all
Cannot parse argument 'all' of option request-required-acks
{code}

The code seems to expect it to be an integer:
https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/tools/ConsoleProducer.scala#L178-L182

If I pass in an Integer, though, the error message for it says that "all" is a 
valid value.

{code}
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test 
--request-required-acks 2
org.apache.kafka.common.config.ConfigException: Invalid value 2 for 
configuration acks: String must be one of: all, -1, 0, 1
        at 
org.apache.kafka.common.config.ConfigDef$ValidString.ensureValid(ConfigDef.java:827)
        at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:427)
        at 
org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:55)
        at 
org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:62)
        at 
org.apache.kafka.clients.producer.ProducerConfig.<init>(ProducerConfig.java:338)
        at 
org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:188)
        at kafka.producer.NewShinyProducer.<init>(BaseProducer.scala:40)
        at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:45)
        at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
{code}

Either the kafka-console-producer.sh needs to be updated to accept "all", or 
the documentation for kafka-console-producer should be updated to say that 
"all" is not a valid value. Either way, the two should be in sync with each 
other.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to