Apache Sling Jobs Support

Clone this repo:
  1. e088c4a SLING-12094 - Use GitHub for the Maven scm.url value by Robert Munteanu · 7 months ago master
  2. efca2cc SLING-11709 - Set up Jira autolinks to all Sling Github projects by Robert Munteanu · 1 year, 1 month ago
  3. 1451bef SLING-11345: Sling bundle parent update to 47 (#2) by Ashok Pelluru · 2 years ago
  4. 14d1d7d SLING-11051 - Fixing JavaDoc badge by Dan Klco · 2 years, 4 months ago
  5. cb14c5a SLING-10676 - remove SECURITY.md which is not needed by Bertrand Delacretaz · 2 years, 10 months ago

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central Contrib License

Apache Sling Jobs Support

This module is part of the Apache Sling project.

Sling Jobs, not to be confused with Sling Event bundle.

This Bundle provides Job processing using a message queue. It aims to do that using off the shelf queues. It does not provide an API that allows interaction with the queue beyond that is supported by the ISO AMQP standard or the JMS API. Although the classes here may have similar names to the API in org.apache.sling.event.jobs, they are not the same. Methods present in org.apache.sling.egent.jobs API that are not compatible with a distributed message queue concept are not included, and the API is designed with message passing in mind.

How it works.

MoM Queues transport messages that control the state of a Job taking it through a lifecycle from creation to distruction. Not all messages are required to live that lifecycle, only the create message is required under normal circumstances.

A MoM QueueReader implemented by the JobQueueConsumerFactory consumes messages from MoM Queues. This is a OSGi Configuration Factory allowing many JobQueueConsumers to dequeue messages from a MoM Queue. When a message is dequeued and identified correctly as a Job related message, it is forward to the JobSubsystem component.

The JobSubsystem component allows JobConsumers to register with it. It interprets the messages, creating Jobs and managing their lifecycle. It will identify JobConsumers that can consume the job and invoke the execute method on the JobConsumer.

JobConsumers are where the job itself is implemented. Components that implement this API are registered as services which get registered by OSGi DS with the JobSubsystem. Each JobConsumer declares a list of JobTypes it will consume. There is a special JobType of ANY_TYPE for consumers that want to consume any Job. To use the JobSubsystem you will need to implement your own JobConsumers. There are examples of JobConsumers in this source code area.