AEM Scheduler Needs to auto-start after Deployment | Community
Skip to main content
rsl_lucky
Level 4
January 6, 2020
Solved

AEM Scheduler Needs to auto-start after Deployment

  • January 6, 2020
  • 2 replies
  • 7010 views

Hi All,

Need AEM scheduler code in a bundle to pick osgi configuration and start execute automatically as soon as bundle is deployed.
Currently after deploying the bundle with scheduler code in it, every time have to save OSGI configuration for respective scheduler to get it start.

Any pointers across it would be really appreciated.

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 arunpatidar

Hi,

Can you check if you used both Activate and Modified annotations for activate mathod

Sample Code - 

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleScheduledTask.java

 

@580286 @Modified protected void activate(final Config config) { myParameter = config.myParameter(); }

 

2 replies

rsl_lucky
rsl_luckyAuthor
Level 4
January 6, 2020

Already have set immediate = true but still no use

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
January 6, 2020

Hi,

Can you check if you used both Activate and Modified annotations for activate mathod

Sample Code - 

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleScheduledTask.java

 

@580286 @Modified protected void activate(final Config config) { myParameter = config.myParameter(); }

 

Arun Patidar
rsl_lucky
rsl_luckyAuthor
Level 4
January 6, 2020
Yes have included. Using OSGi r6 annotations for configuration class but could observe that activate method is called but not run() method, not sure no logs of error are thrown.