I deployed the application in JBoss with master and slave due to which my scheduler running twice. ShedLock is not solution for my problem as the email will triger till user deactivate the expired Asset. So I though of checking the request is from master or slave and based on it I will run my code, any idea how to figure it or any other solution. Thank you I am using Spring 4.x and REST web-service with MySQL db.
@Scheduled(cron = "${scheduler.i18n.crontime}")
public void getAssetNotification() {
try {
notificationDao.getAssetNotification(null);
} catch (Exception e) {
logger.error("getAssetNotification() - error in getAssetNotification", e);
}
}