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

Exception thrown when running console producer with no port number for the broker

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.8.1.1
    • Fix Version/s: 0.8.2.0
    • Component/s: None
    • Labels:

      Description

      When running console producer with just "localhost" as the broker list, I get ArrayIndexOutOfBounds exception.

      I expect either a clearer error about arguments or for the producer to "guess" a default port.

      [root@shapira-1 bin]# ./kafka-console-producer.sh --topic rufus1 --broker-list localhost
      java.lang.ArrayIndexOutOfBoundsException: 1
      at kafka.client.ClientUtils$$anonfun$parseBrokerList$1.apply(ClientUtils.scala:102)
      at kafka.client.ClientUtils$$anonfun$parseBrokerList$1.apply(ClientUtils.scala:97)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      at scala.collection.AbstractTraversable.map(Traversable.scala:105)
      at kafka.client.ClientUtils$.parseBrokerList(ClientUtils.scala:97)
      at kafka.producer.BrokerPartitionInfo.<init>(BrokerPartitionInfo.scala:32)
      at kafka.producer.async.DefaultEventHandler.<init>(DefaultEventHandler.scala:41)
      at kafka.producer.Producer.<init>(Producer.scala:59)
      at kafka.producer.ConsoleProducer$.main(ConsoleProducer.scala:158)
      at kafka.producer.ConsoleProducer.main(ConsoleProducer.scala)

        Attachments

        1. KAFKA-1618-REUSED-UTILS.patch
          2 kB
          BalajiSeshadri
        2. KAFKA-1618-ALL-VERSION.patch
          1.0 kB
          BalajiSeshadri
        3. KAFKA-1618-CLEAN.patch
          10 kB
          BalajiSeshadri
        4. KAFKA-1618-REBASED.patch
          24 kB
          BalajiSeshadri
        5. KAFKA-1618-ALL.patch
          24 kB
          BalajiSeshadri
        6. KAFKA-1618-REVIEW-COMMENTS-SPACE-CORRECTION.patch
          163 kB
          BalajiSeshadri
        7. KAFKA-1618-REVIEW-COMMENTS.patch
          118 kB
          BalajiSeshadri
        8. KAFKA-1618-ALL.patch
          42 kB
          Balaji Seshadri
        9. KAFKA-1618.patch
          2 kB
          BalajiSeshadri

          Activity

            People

            • Assignee:
              balaji.seshadri@dish.com BalajiSeshadri
              Reporter:
              gwenshap Gwen Shapira
              Reviewer:
              Neha Narkhede
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: