title: Spring Kafka Stop container on Exception
body: <p>I am using <code>ConcurrentMessageListenerContainer</code> with auto commit set to false to consume messages from the topic and write to Database. If Database is down I need to stop the container from processing current record in a poll and don't do next <code>poll()</code>. I have implemented <code>DataSourceHealthIndicator</code> and after checking Database status to UP I want to restart my container again to process remaining records.</p>
  
  <p>Any suggestion how can I stop processing remaining records and stop the container, I have tried to use <code>consumer.close()</code>. But it doesn't stop the process and kept throwing consumer is already closed.</p>