Search code examples
quartz-scheduleraemapache-felixosgi-bundlesling

Creating a custom task scheduler in Adobe CQ


  1. We have a specific requirement to create a custom scheduler in CQ to perform some admnistrative tasks based on some parameters specified by the administrator. I have seen the Scheduler service offered by Sling. But wanted to know whether there is any issues in using Quratz APIs direcly rather than using this sling wrapper to schedule the tasks? Wanted to know did any one us alredy has developed such a CQ Component?

  2. Is there any issue in invoking CQ flush agent programatically (as a scheduled Job, which runs periodically based on some configurations)?

Any pointers in this area would help us a lot. Thanks,

San


Solution

    1. Schedulers in CQ are working well. I programmed many in my years as a CQ developer. It is an OSGi service either implementing the java.lang.Runnable or org.apache.sling.commons.scheduler.Job. The former is usually enough. You only have to configure the scheduler.expression property which follows the quartz syntax and implement the run method.

    2. I can't answer that as I never tried it. But I don't see why it shouldn't work. At my customer we have an independent cron job deleting the dispatcher cache instead of using a flush agent.