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

Producer hangs on TimeoutException: Failed to update metadata after 60000 ms.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.0
    • None
    • clients
    • None

    Description

      I start Kafka in Docker:

      docker run --rm -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST="127.0.0.1" spotify/kafka

       

      Then, I connect KafkaProducer to that Kafka (127.0.0.1:9092) and immediately I call producer.send() . The send() method always blocks for 60s and then fails and callback receives TimeoutException. The producer is therefore unable to send any message which renders it useless.

      A workaround is to sleep for 1-2 seconds after the Producer is constructed and before first send() is invoked - that apparently gives enough time to Kafka to synchronize whatever it needs and no longer block endlessly in send()

      Attachments

        Activity

          People

            Unassigned Unassigned
            vyzivus Martin Vysny
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: