Scheduling jobs in AEM Author Environment | Community
Skip to main content
richac96395021
Level 4
January 24, 2018
Solved

Scheduling jobs in AEM Author Environment

  • January 24, 2018
  • 3 replies
  • 3608 views

Dear team,

We have scheduled a job on author environment it is working fine, but my concern is when the project is replicated on publish environment will the job be also scheduled on publish. If yes then please suggest how do we avoid this scenario.

Note:- Currently My project folder contains component rendering, servlets and scheduler classes

with regards,

Richa Chaubey

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

In your scheduling service you can define

  • @Component(policy = ConfigurationPolicy.REQUIRE)

Now, create only the OSGI Config only for author runmode.

Your service will never be satisfied in publish instance so no execution.

You can refer: http://www.computepatterns.com/43/osgi-component-in-aem-that-is-active-only-in-specific-run-mode-say-publish/

3 replies

cquser1
Level 7
January 24, 2018

Hi,

Generally have seen activate methods in scheduler which will have something like

this.isEnabled = PropertiesUtil.toBoolean(properties.get("scheduler.enable"), false);

So, may be by default its disabled and only if enabled it will work , irrespective of the environments.

May be we can await inputs from other members as well on this.

smacdonald2008
Level 10
January 24, 2018
edubey
edubeyAccepted solution
Level 10
January 24, 2018

In your scheduling service you can define

  • @Component(policy = ConfigurationPolicy.REQUIRE)

Now, create only the OSGI Config only for author runmode.

Your service will never be satisfied in publish instance so no execution.

You can refer: http://www.computepatterns.com/43/osgi-component-in-aem-that-is-active-only-in-specific-run-mode-say-publish/