title: Check MongoDB connection using MongoTemplate in Spring Boot
body: <p>I am working on Spring Kafka Mongo Integration for insert/update operations and using mongotemplate to perform these actions. I want to know is there any way to check mongodb connection is up/down so that in case my db goes down I want to commit kafka offset manually. Currently, all the db configurations are provided in application.properties file</p>