Solved! Go to Solution.
Views
Replies
Total Likes
This is not possible in a reliable way just by AEM ootb tools.
What business requirement are you trying to solve?
I need to call same scheduler which is present in different publisher but the call should be in serial order
Not sure about the your actual requirement, but if you need to execute the scheduler in 2 or more publishers in a serial manner, then you may calculate the time it is taking to finish this scheduler job and set the scheduler cron job on Publish 1 and Publish 2 accordingly.
For Example: If the job is taking 15 mins to finish, the set the cron expression to run the job at 12.00am on publish 1 and then 12.15 on publish 2.
Hello @Prakul -
Here is a solution which I can think of on a high level reading through your requirements :
In AEM as a Cloud Service, you can achieve the inter-scheduler communication and activation by utilizing the Sling Job Queue and Eventing mechanisms. Here's an outline of the approach:
1. Define the first scheduler in the first publisher:
- Create a Sling Job Queue by extending `JobConsumer` and implementing the desired service logic.
2. Implement the service in the first publisher:
- Write the code for the service that needs to be executed by the first scheduler.
- Ensure that the service logic is completed before proceeding to the next step.
3. Configure the second scheduler in the second publisher:
- Create another Sling Job Queue following the same approach as the first scheduler.
- Define the logic that needs to be executed by the second scheduler upon activation.
4. Establish communication between the publishers:
- Use the Sling Eventing mechanism to trigger an event from the first publisher after the service logic within is completed.
- Configure an Event Handler in the second publisher to listen for this event.
5. Trigger the second scheduler from the first publisher:
- After the service in the first publisher completes, use the Sling Eventing mechanism to publish an event.
6. Activate the second scheduler in the second publisher:
- The Event Handler in the second publisher listens for the event published in the first publisher.
- Upon receiving the event, the handler can activate the second scheduler, and the associated logic will be executed.
Hello @Prakul Based on your requirement, it seems that you need to establish a sequential connection between a scheduler in Pub1 and Pub2. Presumably, these schedulers have specific tasks to perform.
Here's my suggestion: utilize a single scheduler alongside an OSGi service. The scheduler will be set to execute at a specific time from Pub1, and upon execution, it will call the OSGi service. To introduce time delays between the calls, you can incorporate appropriate logic within your Java implementation. In my opinion, this solution offers a more efficient approach. If you have the authority to make decisions in your project, I recommend proposing this solution.
Thank you,
-Bilal
This is not possible in a reliable way just by AEM ootb tools.
What business requirement are you trying to solve?
Views
Likes
Replies