Our component has multiple camel-quartz schedulers. When we deploy multiple instances of our application on different servers, these scheduler runs in all the instances and execute the logic. We want that only one of those instances should run the scheduler.
To achieve this, we are thought of using clustered scheduling mode of Quartz. For that I read that we need to put relevant properties in quartz.properties file with isClustered=true. Point to note here is we are using Apache Ignite as our persistent store. So I also put ignite jdbc thin driver as our datasource. The properties file is placed in src/main/resources folder and our camel routeBuilder is as below:
public void configure() throws Exception
{
AbstractApplicationConfiguration.RouteConfig routeConfig = appConfig.getCamel().fetchRoute(ROUTE_ID);
from(routeConfig.getInputEndpoints()[0])
.to(appConfig.getCamel().getMetricEndpoints().getTimerEndpoint() + "&" + CAMEL_MICROMETER_ACTION_START + "&" + CAMEL_MICROMETER_TAG_ROUTE + ROUTE_ID)
.to(appConfig.getCamel().getMetricEndpoints().getCounterEndpoint() + "&" + CAMEL_MICROMETER_ACTION_START + "&" + CAMEL_MICROMETER_TAG_ROUTE + ROUTE_ID)
}
According to the resource used as reference to achieve this: https://developers.redhat.com/blog/2017/08/10/using-clustered-camel-quartz-jobs-on-jboss-eap the quartz.properties should be set by default, but when we run our application in two different instances, the scheduler is still running in both the instances.
After running this application in debug mode also I am not able to see that Camel is able to read this properties file. When I run multiple schedulers on my machine all of them execute. So clustering is not happening anyways.
Kindly help on how do we set the quartz.properties file to the propertiesFile of camel-quartz component configuration?