I am writing a long-running job that is expected to be intensive and long-running. The Asynchronous Operations looks promising and the Jobs console is nice similar to workflow console, showing job status, logs etc.
How to write a new custom async job? Am able to create sling job, stores into /var, but it is NOT showing in Jobs console. How to get the custom jobs show under Tools --> General --> Jobs console?
Solved! Go to Solution.
Views
Replies
Total Likes
In order to see your custom job under Tools --> General --> Jobs console, you've to write a new class implementing
AsyncOperationConfigProviderService
separate from the actual sling async job implementation.
This Servlet renders jobs data in console -
AsyncJobsDataSourceServlet
which displays the jobs that are implementing AsyncOperationConfigProviderService. For reference, please check the following component services in OSGi console (/system/console/components)
One thing I could not confirm is that uber-jar or aem-sdk-api(for cloud service) exposes the AsyncOperationConfigProviderService for custom implementation.
Looks like Async APIs are Adobe internal APIs and you can not use same. I used Java Decompiler to check how Async jobs are created. This is the class Adobe has used to extend to write Async Job :
com.adobe.granite.jobs.async.commons.AbstractAsyncJobExecutor
But there is not much information of same online.
If you want to see the status of Sling jobs, you can go to /system/console/slingevent and search for the topic you used to create a job. It will show you the count of failed/completed jobs. For example
Thanks Sachin. Yeah, I too am decompiling, duplicating the code and trying to make it work. Just the Jobs console looks better than felix, shows logs, can add interested properties. Was wondering if anyone had already managed to write a custom async job successfully.
Hi @saravana_sgws were you able to achieve the above custom job in the job console. we are also looking for the same? I have created a sling job and storing csv into the var folder.
can you please share how did you achieve the same in detail? I couldn't find anything in online.
The mentioned package
AsyncOperationConfigProviderService
is not coming in aem sdk or uber jar.
Which dependency needs to be added for this?
Views
Replies
Total Likes
In order to see your custom job under Tools --> General --> Jobs console, you've to write a new class implementing
AsyncOperationConfigProviderService
separate from the actual sling async job implementation.
This Servlet renders jobs data in console -
AsyncJobsDataSourceServlet
which displays the jobs that are implementing AsyncOperationConfigProviderService. For reference, please check the following component services in OSGi console (/system/console/components)
One thing I could not confirm is that uber-jar or aem-sdk-api(for cloud service) exposes the AsyncOperationConfigProviderService for custom implementation.
Views
Likes
Replies