I have Kafka instances running in 2 different VMs. I'm able to send messages to Kafka running in vm-1 using spring kafka-template, but while sending a message to kafka running in vm-2, I'm getting the exception below:
2018-04-19 15:12:57 [kafka-producer-network-thread | producer-1] ERROR o.s.k.s.LoggingProducerListener - Exception thrown when sending a message with key='xxxx' and payload='{79, 98, 106, 1, 4, 22, 97, 118, 114, 111, 46, 115, 99, 104, 101, 109, 97, -28, 51, 123, 34, 116, 12...' to topic xxxxxx-v1: org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for xxxxxx-v1-3: 60043 ms has passed since batch creation plus linger time
Producer configuration
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, x.x.x.x:port);
config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
config.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);
config.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, 60000);
config.put(ProducerConfig.BATCH_SIZE_CONFIG, 1048576);
config.put(ProducerConfig.LINGER_MS_CONFIG, 100);
config.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, 10485760);
config.put(ProducerConfig.ACKS_CONFIG, "all");
I can telnet to both VMs and also ping them.