How to configure OSGI sling jobs to parallel running with custom job consumer. | Community
Skip to main content
April 12, 2020

How to configure OSGI sling jobs to parallel running with custom job consumer.

  • April 12, 2020
  • 3 replies
  • 10304 views

Hi All,

 

I am creating a utility to imports assets from FTP to AEm DAm server. For that I have used jobmanager.addJob("TOPICS","HASHMAP"); My job triggering withexact topic info and importing assets into AEM DAM Server.

 

To implement parallel execution of job Do I need to do anything apart from Apache Sling Job Queue configuration? If Yes then how to take care as there is not much documnetation on the Adobe documentation.

 

If any one implemented parallel jobs execution please provide inputs.

 

1. How to implement parallel execution of jobs. how to confirm that jobs executing parallelly by updating Apache Sling job Queue OSGI Configuration in AEM.

2. When Job is trigered it automatically processing JobResults and stopping reqest from there itselft.How to redirect request from JobConsumer to Osgi Service.

 

Thanks,

Aruna

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

3 replies

arunpatidar
Community Advisor
Community Advisor
April 13, 2020

Hi,

You don't need to do anything to configure parallel job execution.

You just have to take care of parallel execution in your business logic, I meant multithreading.

Arun Patidar
April 13, 2020

Thanks Arun for the reply. 

 

I need some more details on parallel execution. Multi threading means Java multi threading correct.

Is parallel streams work?

April 22, 2020

Thans for the inputs.

 

I would like to understand how to configure sling jobs to execute parallelly on some event?

Is there any documentation? Please help me in understanding more about it?

 

Thanks,

Aruna

arunpatidar
Community Advisor
Community Advisor
April 22, 2020
You need to write an event listener and onEvent method write a logic using thread.
Arun Patidar
aanchal-sikka
Community Advisor
Community Advisor
November 8, 2023

Please refer to this documentation, to have better understanding of the Queues: https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html#queue-configurations

 

 

 

To assure that they are running in parallel:

  • you would have to register many jobs simultaneously
  • Use different param for each registration to help identify the run.

 

Aanchal Sikka