org.apache.sling.event.impl.jobs.JobManagerImpl Discarding job - properties must be serializable: job/topic
Hello,
I am getting an exception when processing DamEvent events on my Job manager that implements EventHandler. I am using code guidelines from references below. My code works fine when processing PageEvent but it does not process the job for DamEvent.
the 23.06.2023 16:43:12.938 *WARN* [EventAdminThread #20] org.apache.sling.event.impl.jobs.JobManagerImpl Discarding job - properties must be serializable: aem/solr/indexing/job : {damEvent=com.day.cq.dam.api.DamEvent@733fc832}
I see this note in the Sling documentation which I don't quite understand: "The job topic follows the conventions for the topic of an OSGi event. All objects in the payload must be serializable and publically available (exported by a bundle). This is required as the job is persisted and unmarshalled before processing."
Also, I see there is a checkJob in the API (https://github.com/apache/sling-org-apache-sling-event/blob/master/src/main/java/org/apache/sling/event/impl/jobs/Utility.java) which describes the exception I am getting.
Is this a bug? I am working on AEM 6.5.15.0
References:
https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html
https://sling.apache.org/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html