Aesthete
Aesthete

Reputation: 133

Kafka console producer does not fail if broker address is incorrect

I run the following command (where <incorrect port> is a number):

bin/kafka-console-producer.sh --broker-list localhost:<incorrect port> --topic some-topic

And the process doesnt fail, it continues as if nothing is wrong

Is there a way upon startup of kafka-console-producer.sh to check the destination broker port has a broker listening to that port upon startup?

I'm using kafka 0.10.2.0 on osx 10.12.3

Upvotes: 0

Views: 220

Answers (1)

Matthias J. Sax
Matthias J. Sax

Reputation: 62310

That's by design... The producer just assumes, that the broker will get available at the specified port eventually. However, the producer should time out at some point (IIRC the default is 5 minutes). You can reduce the timeout config to get the error earlier via request.timeout.ms or metadata.fetch.timeout.ms.

Upvotes: 1

Related Questions