I have a SpringBoot Scheduler which is executed every 1 sec. The scheduler throws InterruptedException . Now ,this scheduler often stops working and then gets restarted automatically after few minutes. The InterruptedException is not handled anywhere in the code. So ,can this be the reason of the scheduler stopping? If yes , how can this exception be handled? Below is the code snippet-
@Scheduled(fixedRateString = "${OUTBOUND_MESSAGE_CHK_SCHEDULE_FREQUENCY}")
public void fetchOutBoundMessages() throws InterruptedException{
log.debug("fetchOutBoundMessages started>>");
if(LockHolder.hasValidLock()){
log.debug("Fetching Outbound message for >>>>>>>>>");
JSONArray jsonArrayObj= service.putOutBoundService(boroCode);
}
else {
log.info("Lock has not available..");
}
}```