Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

arunaaems506124
Level 2
Level 2

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

5 Replies
Arun_Patidar
Community Advisor
Community Advisor

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.

arunaaems506124
Level 2
Level 2

Thanks Arun for the reply. 

 

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

Is parallel streams work?

Arun_Patidar
Community Advisor
Community Advisor
Hi, Yes, you can use java multithreading. The sling jobs run parallel based on time or events etc. Just make sure one 2 same job should not work on 1 item at the same time.
arunaaems506124
Level 2
Level 2

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

Arun_Patidar
Community Advisor
Community Advisor
You need to write an event listener and onEvent method write a logic using thread.