I think KafkaProducer.send method blocks until it fetches partition metadata for configured time using "metadata.fetch.timeout.ms", once time out it throws TimeoutException. You might be experiencing TimeoutException ?
ref: KafkaProducer.java(waitOnMetadata) On Fri, Mar 20, 2015 at 2:42 PM, Samuel Chase <samebch...@gmail.com> wrote: > @Tao, > > On Fri, Mar 20, 2015 at 12:39 PM, tao xiao <xiaotao...@gmail.com> wrote: > > You can set producer property retries not equal to 0. Details can be > found > > here > > http://kafka.apache.org/documentation.html#newproducerconfigs > > I set "retries" to "1", but send is still blocking until the Kafka > Server is reachable again. > > @Everyone, > > After successful initialization of the KafkaProducer, If Kafka becomes > unreachable for a short while, any further sends wait indefinitely > (when calling .get() on the future returned by .send()). Is there any > way of detecting that Kafka is unreachable? > > Samuel > -- SunilKalva