How do I start SchedulerServices
I've created a daily cron job that isn't quite working. I can see in the logs that it is running on the designated schedule. I am working in LTS 2021 testing in localhost. How do I start SchedulerServices? The warning in the Log: “WARN [Quartz_Worker-1] [org.nuxeo.runtime.model.impl.ComponentManagerImpl] The component exposing the service: interface org.nuxeo.ecm.core.scheduler.SchedulerService has failed to start”.
We figured this out. We created an XML extension for the SchedulerService and for the event handler:
<extension target="org.nuxeo.ecm.core.scheduler.SchedulerService" point="schedule"> <schedule id="scheduledTrashMaintenance"> <event>scheduledTrashMaintenanceEvent</event> <eventCategory>default</eventCategory> <!-- every 10 minutes --> <cronExpression>0 0/10 * ? * *</cronExpression> </schedule> </extension> <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="event-handlers"> <handler chainId="Trash_Maintenance"> <event>scheduledTrashMaintenanceEvent</event> </handler> </extension>
The event handler calls an automation chain that now runs based on the defined cron schedule. An issue that we had is that setting up the event handler in Studio defaulted to setting a filter on “regular document” instead of “any” so we just decided to add the handler in the extension instead for simplicity sake.