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


Sling job not being processed by custom consumer


Level 3


Currently I have the following situation:

I've made an EventListener that listens for the ReplicationAction.EVENT_TOPIC. To prevent the listener from getting blacklisted, I schedule a sling job in the following way:

String TOPIC = "test/jobHandler";

final Map<String, Object> properties = ImmutableMap.of(


   SlingConstants.PROPERTY_PATH, pagePath,


   Job.PROPERTY_JOB_TITLE, String.format("Consuming page %s", pagePath)


jobManager.addJob(TOPIC, properties);

Now, my consumer is created as following:


   immediate = true,
   property = {

  JobConsumer.PROPERTY_TOPICS + "=" + TOPIC

public class JobHandler implements JobConsumer {

   public JobResult process(final Job job) {"Inside process");

   return JobResult.OK;


The weird thing is: the job itself gets added, according to the output of the job manager, but my consumer code never seems to run (I don't see the log statement), except when I deploy my complete application code again to the AEM instance OR when I stop and start my bundle again. Only stopping and starting the component does NOT work!

I've checked /var/eventing and it shows the job in the "assigned" folder, meaning that there has been a consumer that has picked it up, but it never gets finished. If I disable my JobHandler, then the job gets put in the "unassigned" folder, so that indicates that indeed my consumer is picking them up, but not doing anything with them.

If I check the statistics under /system/console/slingevent, then there is no job being added for that specific topic. The queue "test" is also always empty.

The configuration of the queue:

Screen Shot 2018-02-09 at 11.25.46.png

Some logs from the scheduling of the job:

09.02.2018 11:15:50.101 *INFO* [Thread-9] core.publish.scheduler.JobScheduler queue name test

09.02.2018 11:15:50.102 *INFO* [Thread-9] core.publish.scheduler.JobScheduler created instance fa85aace-0d53-46e6-9b93-157d7b76445f

09.02.2018 11:15:50.102 *INFO* [Thread-9] core.publish.scheduler.JobScheduler id 2018/2/9/11/15/fa85aace-0d53-46e6-9b93-157d7b76445f_95

09.02.2018 11:15:50.102 *INFO* [Thread-9] core.publish.scheduler.JobScheduler job state QUEUED

09.02.2018 11:15:50.102 *INFO* [Thread-9] core.publish.scheduler.JobScheduler target instance fa85aace-0d53-46e6-9b93-157d7b76445f

09.02.2018 11:15:50.106 *INFO* [Thread-9] core.publish.scheduler.JobScheduler step count -1

09.02.2018 11:15:50.106 *INFO* [Thread-9] core.publish.scheduler.JobScheduler topic test/JobHandler

Not really sure what the problem here is.

To summarize:

* all components are active

* all of the custom components are active

* jobs are "assigned" but never finished

* jobs get finished after the bundle with the job consumer gets installed/update/package refresh

Environment specs:

Debian Jessie 9

AEM 6.3 SP 1 CFP 2 (

OSGi annotations: R6 -> not felix, and please, do not suggest anything with felix annotations

Kind regards


1 Accepted Solution


Correct answer by
Level 3

It seemed like simply "restarting" AEM fixed it?

Very weird, as it showed no logs, whatsoever.

View solution in original post

0 Replies


Correct answer by
Level 3

It seemed like simply "restarting" AEM fixed it?

Very weird, as it showed no logs, whatsoever.


Level 10

Sometimes restarting fixes small issues like this. I have seen that before.


Level 1

I was also having the same problem once - found that we were saving a custom object in the payload which AEM was saving as Binary data on the Sling job's properties. Saving it as a String solved the issue.


Level 3

The root cause of the problem that custom objects are prohibited from being deserialized. See more at stackoverflow answer:

aem - Sling job not being processed with custom serializable property - Stack Overflow