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.