Hell All, I am using kafka 1.0.2 client version . Kafka producer does not get timed out if unable to connect to brokers. I only see a WARN message from the cluster.What I am looking for is the producer to throw an exception.How can this be achieved ?
2018-07-24 10:21:59.616 WARN 10280 --- [pool-1-thread-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=kafkaAlive, groupId=kafkaAlive] Connection to node -3 could not be established. Broker may not be available. 2018-07-24 10:22:20.622 WARN 10280 --- [pool-1-thread-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=kafkaAlive, groupId=kafkaAlive] Connection to node -2 could not be established. Broker may not be available. 2018-07-24 10:22:41.627 WARN 10280 --- [pool-1-thread-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=kafkaAlive, groupId=kafkaAlive] Connection to node -1 could not be established. Broker may not be available. Producer Config: configs.put(ProducerConfig.ACKS_CONFIG, "all"); configs.put("block.on.buffer.full", "true"); configs.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); configs.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); configs.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, "1000"); configs.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, "1000"); configs.put(ProducerConfig.METADATA_MAX_AGE_CONFIG, "1000"); configs.put(ProducerConfig.RETRIES_CONFIG, "0"); Thanks, Chinchu