I am trying to send 4000 messages(Json format to KAFKA. But after sending around 3900 messages every time I get the below error. How can I avoid getting the below error?
I am using JsonSerialiser for Kafka value .
org.apache.kafka.common.errors.TimeoutException: Expiring 11 record(s) for <topic-name_here> : 121046 ms has passed since batch creation
Below is my Kafka configuration settings
acks==allretries=3
retry.backoff.ms=1500
request.timeout.ms= 200000 // 200 sec
linger.ms= 3000 ms // 30 sec
batch.size=32000
compression.type=gzip
Below is my code snippet for Kafka OnSucess() method for Kafka send. I am using an asynchronous call I tried tweaking batch.size ,buferr.memory and max.block.ms but still getting the same error.
@Overridepublic
void onSuccess(SendResult<String, Person> result)
{
//SendResult to create a java object for each message
//Call a stored proc to save the object in database for each message
}