I have a Spring Boot Kafka Stream application that reads the records do some HTTP calls and transform the record into another form. This transform record is then sent to the producer.
final KStream<String, String> toSquare = builder.stream(eventTopic,
Consumed.with(Serdes.String(), Serdes.String()));
toSquare.mapValues(recodProcessor::processMessage).to(notificationTopic,
Produced.with(Serdes.String(), Serdes.String()));
Sometimes processMessage
method is taking more than 5 min to execute based on the input event. max.poll.interval.ms
is configured as 5 min. This is triggering rebalancing. Also, we are seeing the lag start building up for the particular partition.
How Kafka stream can be configured to handle such a scenario like throwing an error and pushing a record in DLQ and moving to the next record?