Not able to find org.apache.sling.jobs.JobManager package | Community
Skip to main content
April 18, 2016

Not able to find org.apache.sling.jobs.JobManager package

  • April 18, 2016
  • 2 replies
  • 2847 views

Hi Team,

I am not able to get  org.apache.sling.jobs.JobManager. I can only able to find org.apache.sling.event.jobs.Jobmanager.

But in below sling documentation i read that we can import sling.jobs.JobManager,

https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html#jobs-guarantee-of-processing

And i am not able to schedule jobs using publisher and consumer approach. Kindly let me know how to use JobManager.addjob().schedule.

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

2 replies

smacdonald2008
Level 10
April 18, 2016

To schedule Jobs using the Sling API - you use APIs such as:

https://sling.apache.org/apidocs/sling7/org/apache/sling/commons/scheduler/Scheduler.html

You use Dependency injection to inject a Scheduler service. See this community to learn how to build an OSGi service that schedule AEM JOBs; 

Scheduling Adobe Experience Manager Jobs using Apache Sling

April 21, 2016

Hi smacdonald2008,

Thank you for your answer. But could you please guide me how to achieve "Guarantee of Processing" if I use runnable to schedule the job.

smacdonald2008
Level 10
April 21, 2016
aanchal-sikka
Community Advisor
Community Advisor
November 6, 2023

Please refer to https://techrevel.blog/2023/11/06/enhancing-efficiency-and-reliability-by-sling-jobs/#scheduled-jobs

 

It has the relevant code snippet.

We need to use org.apache.sling.event.jobs.JobManager instead of org.apache.sling.jobs.JobManager.

Aanchal Sikka