We are using AggregatingReplyingKafkaTemplate for sending and recieving a reply of messages.
I want to increase the timeout. But it seems the Kafka Listener is timing out in this case in around 30-40 seconds.
I have tried increasing the default timeout to 10 mins (just for testing ). But it did not help
aggregatingReplyingKafkaTemplate.setDefaultReplyTimeout(Duration.ofSeconds(600)); //changing the default timeout
Code when we are sending the message
private final AggregatingReplyingKafkaTemplate<String, T, R> aggregatingReplyingKafkaTemplate;
public RequestReplyFuture<String, T, Collection<ConsumerRecord<String, R>>> sendAndReceive(String producerTopic, T record, Headers headers) {
ProducerRecord<String, T> producerRecord = new ProducerRecord(producerTopic, record);
addHeaders(producerRecord, headers);
return this.aggregatingReplyingKafkaTemplate.sendAndReceive(producerRecord);
}
Best Regards,
Saurav