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

KafkaProducer hangs on future.get()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Won't Fix
    • 0.8.2.1, 0.8.2.2
    • None
    • None
    • None
    • Windows 8 PC connecting to local ubuntu VM running kafka in docker image with topic set up having 1 partition and a replication factor of 1

    Description

      When running the Kafka Producer at the end of this description, the following problems occur:

      1) If the ip address of the server running the kafka queue is incorrect or unavailable, the producer times out without ever indicating that the node could not be found. The time out exception should indicate if the node could not be connected to in the first place or if communication timed out during communication with the node.

      2) In my situation, the client connects to the kafka queue according to server logs, but never returns from the get() call on the producer side. This get call too should time out indicating what the producer was waiting on when it timed out. At present there are no details to indicate how to debug.

      The issue is a blocker in my view because there are no error details that allow debugging of the issue even when the log4j properties of the server are set as detailed as possible.

      public class BrokenProducer
      {
      public static void main(String[] args)
      {
      Properties properties = new Properties();
      properties.put("bootstrap.servers", "<VM IP address>:9092");
      properties.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
      properties.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
      KafkaProducer producer = new KafkaProducer<String,String>( properties );
      try

      { producer.send(new ProducerRecord("myQueue", "aString")).get(); }

      catch (Exception e)

      { e.printStackTrace(); }

      producer.close();
      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            longtimer Jason Kania
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: