We use Spring Kafka Client on a project. Recently we noticed that if a Kafka Consumer dies due to OutOfMemoryError service continues operating normally and no new consumers get created. The only way to fix this is to monitor OOM in logs and restart the service manually. We are looking for a way to make consumer recreation automatic, e.g.:
- Force Spring (somehow) to detect died consumers and in runtime create new ones.
- In case of OOM in consumer thread kill the entire service, so that AWS auto-scaling group can create a new instance of the service.
Any suggestions or ideas are appreciated. Thank you!