Hello Everyone, In the the new Java Producer API, the Callback code in KafkaProducer.send is run after there is a response from the Kafka server. This can be used if some error handling needs to be done based on the response.
When using the new Java Kafka Producer, I've noticed that when the Kafka server is down/unreachable, KafkaProducer.send blocks until the Kafka server is back up again. We've been using the older Scala Producer and when Kafka is unreachable it throws an exception after a few retries. This exception is caught and then some error handling code is run. - What is the recommended way of using the new Java Producer API to handle the case where Kafka is unreachable temporarily? I don't want to wait until it is reachable again before I know that the send failed. Any help, advice shall be much appreciated. Thanks, Samuel