Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Sling jobs random distribution in mongo cluster of 2 author instances in AEM 6.5

Avatar

Level 6

We have mongo cluster of 2 author instances and the sling jobs distribution is random.

 

Adobe says, in author cluster by default sling jobs will be distributed to all nodes in the cluster. But in our case sling jobs are randomly distributing i.e. sometimes jobA is getting distributed two author instances and sometimes same jobA with different payload map is executing in only author1 instance but not in author2. Any suggestions for this random behaviour?

 

Thanks,

Ramesh.

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @arunpatidar @giuseppebag ,

 

I have debugged the issue further and found that the jobs were distributing to other instance because of load. A job with same topic was running on author1 hence job2 was distributed to author2.

To know or if someone is looking for execution of jobs in same instance where they are created then they can create a job queue for the topic and enable queue.preferRunOnCreationInstance=B"true" then it will ensure job running in same instance instead of load distributing.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @Uppari_Ramesh 

Not sure if this can help or not.

 

The client sending an event has to mark an event to be distributed in a cluster by setting the event.distribute in the event properties

 

https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html#event-dis... 

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 10

Consider also the following steps:

  • verify node capabilities and ensure both nodes are capable of processing the job topics.
  • check job consumer registrations and confirm that both nodes have the necessary jobconsumer services registered for the job topics.
  • you can use the sling topology and job handling mechanisms to monitor how jobs are being distributed across nodes.
  • if jobs with different payloads are being executed on different nodes, it might be due to how the payload is constructed or how the job is initiated.

 

 

Avatar

Correct answer by
Level 6

Hi @arunpatidar @giuseppebag ,

 

I have debugged the issue further and found that the jobs were distributing to other instance because of load. A job with same topic was running on author1 hence job2 was distributed to author2.

To know or if someone is looking for execution of jobs in same instance where they are created then they can create a job queue for the topic and enable queue.preferRunOnCreationInstance=B"true" then it will ensure job running in same instance instead of load distributing.