Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.1.0
-
None
-
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()