SlideShare una empresa de Scribd logo
1 de 73
Descargar para leer sin conexión
FROM EVENTING TO JOB PROCESSING
Carsten Ziegeler | Adobe Research Switzerland
1
2
•  RnD Team at Adobe Research Switzerland
•  Co-founder Adobe Granite
•  OSGi Core Platform and Enterprise Expert Groups
•  Member of the ASF
•  Current PMC Chair of Apache Sling
•  Apache Sling, Felix, ACE
•  Conference Speaker
•  Technical Reviewer
•  Article/Book Author
cziegele@adobe.com
@cziegeler
ABOUT
3
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
4
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
5
OSGI EVENT ADMIN
Publish / Subscribe Model
OSGi Event Admin
Component
A
publish
deliver
Component
X
Component
Y
6
•  OSGi event is a data object with
•  Topic (hierarchical namespace)
•  Properties (key-value-pairs)
•  Page Event
•  Topic: com/day/cq/wcm/core/page
•  Properties: path, change type (add/remove/edit) etc.
OSGI EVENT ADMIN
Publish / Subscribe Model
7
•  Publisher creates event object
•  Sends event through EventAdmin service
•  Either sync or async delivery
•  Subscriber is an OSGi service (EventHandler)
•  Service registration properties
•  Interested topic(s)
•  com/day/cq/wcm/core/*
•  Additional filters (optional)
•  (type="add“)
OSGI EVENT ADMIN
Publish / Subscribe Model
8
•  Immediate delivery to available subscribers
•  No guarantee of delivery
•  No distributed delivery
OSGI EVENT ADMIN
Publish / Subscribe Model
9
•  Immediate delivery to available subscribers
•  No guarantee of delivery
•  No distributed delivery
OSGI EVENT ADMIN
Publish / Subscribe Model
DiscoverySling Job Distribution
10
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
11
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
New in
5.6.1
12
INSTALLATION SCENARIOS
Clustered CRX
Single
Instance
CRX
Instance
1
Instance
2
Instance
3
13
Instance: Unique Id (Sling ID)
TOPOLOGIES I
Apache Sling Discovery
Clustered CRXCRX
ID : A ID : X ID : 42ID : 1
Single
Instance
Instance
1
Instance
2
Instance
3
14
•  Instance: Unique Id (Sling ID)
•  Cluster: Unique Id and leader
TOPOLOGIES I
Apache Sling Discovery
Cluster 99Cluster 35
Clustered CRXCRX
ID : A ID : X ID : 42ID : 1
Single
Instance
Instance
1
Instance
2
Instance
3
Leader Leader
15
•  Topology: Set of clusters
TOPOLOGIES I
Apache Sling Discovery
Cluster 99Cluster 35
Clustered CRXCRX
ID : A ID : X ID : 42ID : 1
Single
Instance
Instance
1
Instance
2
Instance
3
Leader Leader
TopologyTopology
•  Instance: Unique Id (Sling ID)
•  Cluster: Unique Id and leader
16
TOPOLOGIES I
Apache Sling Discovery
•  Instance: Unique Id (Sling ID)
•  Cluster: Unique Id and leader
•  Topology: Set of clusters
Cluster 99
Clustered CRXCRX
ID : A ID : X ID : 42ID : 1
Single
Instance
Instance
1
Instance
2
Instance
3
Leader
Topology
Cluster 35
Leader
Cluster 99
17
•  Instance
•  Sling ID
•  Optional: Name and description
•  Belongs to a cluster
•  Might be the cluster leader
•  Additional properties which are distributed
•  Extensible through own services (PropertyProvider)
•  E.g. data center, region or enabled job topics
•  Cluster
•  Elects (stable) leader
•  Stable instance ordering
•  TopologyEventListener: receives events on topology changes
TOPOLOGIES II
Apache Sling Discovery
ID : 42
Instance
3
Topology
Leader
18
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
19
•  Job : Guaranteed processing, exactly once
•  Exactly one job consumer
•  Started by client code, e.g. for replication, workflow...
•  Job topic
•  Payload is a serializable map
JOB HANDLING I
Apache Sling Job Handling
20
•  Sling Job Manager handles and distributes jobs
•  Delivers job to a job consumer…
•  …and waits for response
•  Retry and failover
•  Notification listeners (fail, retry, success)
JOB HANDLING I
Apache Sling Job Handling
21
STARTING / PROCESSING A JOB I
Apache Sling Job Handling
public interface JobConsumer {	
	
String PROPERTY_TOPICS = "job.topics";	
	
enum JobResult {	
OK,	
FAILED,	
CANCEL,	
ASYNC	
}	
	
JobResult process(Job job);	
}
public interface JobManager {	
	
Job addJob(String topic, String optionalName, Map<String, Object> properties);	
…	
}
Starting a job
Processing a job
Note: Starting/processing of jobs through Event Admin is deprecated but still supported
New in
5.6.1
22
@Component	
@Service(value={JobConsumer.class})	
@Property(name=JobConsumer.PROPERTY_TOPICS, value="org/apache/sling/jobs/backup")	
public class BackupJobConsumer	
implements JobConsumer {	
	
	
@Override	
public JobResult process(final Job job) {	
// do backup	
return JobResult.OK;	
}	
}
STARTING / PROCESSING A JOB II
Apache Sling Job Handling New in
5.6.1
23
•  New jobs are immediately persisted (resource tree / repository)
•  Jobs are “pushed” to the processing instance
•  Processing instances use different queues
•  Associated with job topic(s)
•  Main queue
•  0..n custom queues
•  For example: replication agent queue or workflow queue
JOB HANDLING II
Apache Sling Job Handling
24
•  Queue is configurable
•  Queue is started on demand in own thread
•  And stopped if unused for some time
•  Types
•  Ordered queue (eg replication)
•  Parallel queues: Plain and Topic Round Robin (eg workflow)
•  Limit for parallel threads per queue
•  Number of retries (-1 = endless)
•  Retry delay
•  Thread priority
JOB QUEUE
Apache Sling Job Handling
25
•  Job Manager Configuration = Main Queue Configuration
•  Maximum parallel jobs (15)
•  Retries (10)
•  Retry Delay
•  Eventing Thread Pool Configuration
•  Used by all queues
•  Pool size (35) = Maximum parallel jobs for a single instance
ADDITIONAL CONFIGURATIONS
Apache Sling Job Handling
26
MONITORING – WEB CONSOLE
Apache Sling Job Handling
27
MONITORING – WEB CONSOLE
Apache Sling Job Handling
28
•  Each instance determines enabled job topics
•  Derived from Job Consumers (new API required)
•  Can be whitelisted/blacklisted (in Job Consumer Manager)
•  Announced through Topology
•  Job Distribution depends on enabled job topics and queue type
•  Potential set of instances derived from topology (enabled job topics)
•  Ordered : processing on leader only, one job after the other
•  Parallel: Round robin distribution on all potential instances
•  Local cluster instances have preference
•  Failover
•  Instance crash: leader redistributes jobs to available instances
•  Leader change taken into account
•  On enabled job topics changes: potential redistribution
JOB DISTRIBUTION
Apache Sling Job Handling
29
•  Scalability in AEM:
•  DAM Ingestion
•  Non-Clustered installation requirement
•  The term Offloading:
•  In AEM used for all things job distribution and topology in clustered and non-
clustered installations, e.g. ‘Offloading Browser’
•  More technically it’s ‘only’ a little add-on in Granite to Sling Job Distribution
for handling non-clustered installations
WHY OFFLOADING
30
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
31
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
32
SLING JOB DISTRIBUTION
Topology
Instance
Sling ID: 1
Job Manager
Instance
Sling ID: 2
Job Manager
Instance
Sling ID: 3
Job Manager
Instance
Sling ID: 4
Job Manager
Job Consumer
Topic: A
Job Consumer
Topic: B
Job Consumer
Topic: C
33
SLING JOB DISTRIBUTION
Instance
Sling ID: 1
Job Manager
Instance
Sling ID: 2
Job Manager
Instance
Sling ID: 3
Job Manager
Instance
Sling ID: 4
Job ManagerA
Job Consumer
Topic: A
Job Consumer
Topic: B
A:2
Job Consumer
Topic: CJob
Topology
34
SLING JOB DISTRIBUTION
Instance
Sling ID: 1
Job Manager
Instance
Sling ID: 2
Job Manager
Instance
Sling ID: 3
Job Manager
Instance
Sling ID: 4
Job ManagerB
Job Consumer
Topic: A
Job Consumer
Topic: B
B:3
Job Consumer
Topic: CJob
Topology
35
SLING JOB DISTRIBUTION
Instance
Sling ID: 1
Job Manager
Instance
Sling ID: 2
Job Manager
Instance
Sling ID: 3
Job Manager
Instance
Sling ID: 4
Job ManagerC
Job Consumer
Topic: A
Job Consumer
Topic: B
C:4
Job Consumer
Topic: CJob
?
Topology
36
SLING JOB DISTRIBUTION
Instance
Sling ID: 1
Job Manager
Instance
Sling ID: 2
Job Manager
Instance
Sling ID: 3
Job Manager
Instance
Sling ID: 4
Job ManagerC
Job Consumer
Topic: A
Job Consumer
Topic: B
C:4
Job Consumer
Topic: CJob
Offloading
Framework
Topology
37
•  Detects offloading jobs
•  Transport of job and job
payload between origin
and target instance
•  Uses replication for the
transport
•  No distribution of jobs
•  No execution of jobs
OFFLOADING FRAMEWORK
Overview
Instance
Sling ID: 1
Job Manager
Offloading
Job Manager
C:4
Instance
Sling ID: 4
Job Manager
Job Consumer
Topic: C
Offloading
Job Manager
C:4
C
Job
Replication
1
2
3 5
4
6
7
Topology
38
•  Replication agents are created automatically
•  Uses naming convention
•  Needs manual adjustments (replication user)
OFFLOADING FRAMEWORK
Replication
Worker
Sling ID: 4
Author
Sling ID: 1
offloading_4
(outgoing agent)
offloading_reverse_4
(reverse agent)
offloading_outbox
(outbox agent)
39
•  Additional properties required
•  Offloading job input
•  Property: OffloadingJobProperties. INPUT_PAYLOAD (offloading.input.payload)
•  Offloading job output
•  Property: OffloadingJobProperties. OUTPUT_PAYLOAD
(offloading.output.payload)
•  Takes comma separated list of paths
•  Used to build the replication package
•  Job sender needs to set these properties for offloading to work!
OFFLOADING FRAMEWORK
Job Payload
40
•  Configures Job Consumers
•  Configures the topic white/black listing properties of each instance
•  What jobs to execute on what instance
•  Configures the distribution
•  Configuration applies for both, clustered and non-clustered installations
OFFLOADING BROWSER
UI
41
OFFLOADING BROWSER
UI
42
OFFLOADING BROWSER
UI
43
OFFLOADING BROWSER
UI
44
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
45
•  New JobConsumer
•  Class: WorkflowOffloadingJobConsumer
•  Topic: com/adobe/granite/workflow/offloading
•  Can launch new workflows
•  Expects the workflow model on the job payload
•  Expects the workflow payload on the job payload
•  For use with clustered and non-clustered installations
WORKFLOW DISTRIBUTION
46
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
47
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
•  Define the job topic
48
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
•  Create service component
•  Must register with topic
•  Implement new JobConsumer
interface
49
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
•  Access job properties (payload)
•  Read workflow model and
payload from job properties
50
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
•  Workflow specific
•  Use workflow API to start
workflow for the given model
and payload
51
@Component
@Service
@Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC)
public class WorkflowOffloadingJobConsumer implements JobConsumer {
public static final String TOPIC = "com/adobe/granite/workflow/offloading";
public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model";
public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”;
public JobResult process(Job job) {
// read workflow model and payload from job payload
String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , "");
String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , "");
// get/create WorkflowSession, WorkflowModel and WorkflowData objects
WorkflowSession wfSession = ..;
WorkflowModel wfModel = ..;
WorkflowData wfData = ..;
// start the workflow
wfSession.startWorkflow(wfModel, wfData, metaData);
// all good
return JobResutl.OK;
}
}
WORKFLOW DISTRIBUTION
Job Consumer (Simplified)
•  Use JobResult enumeration to
report back the job status
52
OVERVIEW
Where to fit in the stack
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
53
•  Default ingestion workflow: “DAM Update Asset”
•  Load is put on the instance where the workflow is started, usually the author
•  New ingestion workflow: “DAM Update Asset Offloading”
•  Needs to be manually enabled by changing the workflow launcher
•  New workflow model with a single step: AssetOffloadingProcess
•  Uses WorkflowExternalProcess API
•  Creates a new job on topic: com/adobe/granite/workflow/offloading
•  Allows distributing the default ingestion workflow
•  Load is put on the instance where the job is distributed to
•  Can be used to distribute in clustered and non-clustered installations
DAM INGESTION
54
@Component
@Service
public class AssetOffloadingProcess implements WorkflowExternalProcess {
@Reference
private JobManager jobManager;
private static final String TOPIC = "com/adobe/granite/workflow/offloading";
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
55
@Component
@Service
public class AssetOffloadingProcess implements WorkflowExternalProcess {
@Reference
private JobManager jobManager;
private static final String TOPIC = "com/adobe/granite/workflow/offloading";
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
•  Create service component
•  Implement
WorkflowExternalProcess
interface
•  Reference JobManager service
56
@Component
@Service
public class AssetOffloadingProcess implements WorkflowExternalProcess {
@Reference
private JobManager jobManager;
private static final String TOPIC = "com/adobe/granite/workflow/offloading";
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
•  DAM and Workflow specific
•  Resolve to Asset
•  Read model from meta data
•  Read workflow payload from
Asset path
57
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
•  ValueMap for job properties
•  Put model and payload on job
properties
•  Used by the JobConsumer
58
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
•  Build offloading payload properties
•  Comma separated list of paths
•  Put them on the job payload as
well
•  Only used for non-clustered
distribution
59
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
Asset asset = ..;
String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”;
String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”;
ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>());
jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel);
jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload);
String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model,
/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ;
jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput);
jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput);
Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties);
return offloadingJob.getId();
}
DAM INGESTION
Create Job (from workflow step)
•  Create job using JobManager
service
•  Use topic from job consumer
•  Put job payload properties
•  Return the jobId as the workflow
process id (workflow specific)
60
@Component
@Service
public class AssetOffloadingProcess implements WorkflowExternalProcess {
@Reference
private JobManager jobManager;
private static final String TOPIC = "com/adobe/granite/workflow/offloading";
public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){
….
}
public boolean hasFinished(Serializable externalProcessId, ..){
// returns null, if job is finished
Job offloadingJob = jobManager.getJobById((String) externalProcessId);
return offloadingJob == null;
}
}
DAM INGESTION
Create Job (from workflow step)
•  Workflow API specific callback
•  Process id = jobId, from
execute()
•  Query job by jobId
•  Workflow step finished when job
is finished
61
•  Choose a job topic
•  Create JobConsumer component and register with topic chosen
•  To create a new job use new JobManager.addJob() API with the topic chosen
and the job payload
•  Add offloading payload to job payload
•  Bundle and deploy JobConsumer on topology instances
•  Enable/Disable the new topic on the instances, using Offloading Browser
DEVELOPMENT - RECIPE
62
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
63
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
org.apache.sling.discovery.api
•  Discovers topology
•  Cross-Cluster detection
•  Foundation for job distribution
64
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
org.apache.sling.event
•  Uses Sling Discovery
•  New JobConsumer API and job topics
•  New JobManager API for creating new distributed jobs
•  Distributes jobs based on available job topics and job queue
configuration.
•  Distributes in the whole topology, including clustered and non-
clustered instances
•  Can execute cluster local jobs only
65
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
com.adobe.granite.offloading.core
•  Builds on top of Sling Distributed Jobs
•  Does not perform distribution
•  Detects jobs distributed to non-clustered instances
•  Transports the jobs and payload to non-clustered
instances
•  Uses replication for transport
•  Does not execute jobs
66
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
com.adobe.granite.workflow.core
•  Defines a job consumer to distribute the execution
of whole workflows
•  Defines topic com/adobe/granite/workflow/
offloading
•  Implements WorkflowOffloadingJobConsumer
component
•  Supports clustered and non clustered installations
67
TAKE AWAY
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
cq-dam-core
•  Makes use of com/adobe/granite/workflow/
offloading topic from Workflow Distribution
•  New workflow step (external step) that creates a
new job on topic com/adobe/granite/workflow/
offloading
•  New “DAM Update Asset Offloading” workflow
•  Supports clustered and non clustered
configurations
68
TAKE AWAY
Potential Future
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
69
TAKE AWAY
Potential Future
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
New OSGi Specification
• Distributed Eventing
• Cloud Computing
70
TAKE AWAY
Potential Future
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
Job Distribution
• Improved load balancing
• Pull based distribution
71
TAKE AWAY
Potential Future
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
Offloading
• As part of job distribution
• Even simpler setup
72
TAKE AWAY
Questions?
Discovery
Offloading Workflow Distribution
DAM Ingestion
Sling
Granite
AEM
Job Distribution
Felix OSGi Event Admin
FromEventingtoJobProcessing
73

Más contenido relacionado

La actualidad más candente

A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityMikhail Egorov
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and SlingLo Ki
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAndrew Khoury
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template LanguageGabriel Walt
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsMikhail Egorov
 
Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson AEM HUB
 
HTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowHTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowPrabhdeep Singh
 
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015WineSOFT
 
Sling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatSling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatAEM HUB
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking themMikhail Egorov
 
Inter-Sling communication with message queue
Inter-Sling communication with message queueInter-Sling communication with message queue
Inter-Sling communication with message queueTomasz Rękawek
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide Isabelle Mauny
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep DiveGabriel Walt
 
Cross-domain requests with CORS
Cross-domain requests with CORSCross-domain requests with CORS
Cross-domain requests with CORSVladimir Dzhuvinov
 
Integration patterns in AEM 6
Integration patterns in AEM 6Integration patterns in AEM 6
Integration patterns in AEM 6Yuval Ararat
 
AEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveAEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveHanish Bansal
 
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...DirkjanMollema
 

La actualidad más candente (20)

A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications security
 
AEM and Sling
AEM and SlingAEM and Sling
AEM and Sling
 
Osgi
OsgiOsgi
Osgi
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser Caching
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template Language
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webapps
 
Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson
 
Sling Models Overview
Sling Models OverviewSling Models Overview
Sling Models Overview
 
HTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowHTL(Sightly) - All you need to know
HTL(Sightly) - All you need to know
 
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015
CloudFront(클라우드 프론트)와 Route53(라우트53) AWS Summit Seoul 2015
 
Sling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatSling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak Khetawat
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking them
 
Inter-Sling communication with message queue
Inter-Sling communication with message queueInter-Sling communication with message queue
Inter-Sling communication with message queue
 
APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide APISecurity_OWASP_MitigationGuide
APISecurity_OWASP_MitigationGuide
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
 
Aem maintenance
Aem maintenanceAem maintenance
Aem maintenance
 
Cross-domain requests with CORS
Cross-domain requests with CORSCross-domain requests with CORS
Cross-domain requests with CORS
 
Integration patterns in AEM 6
Integration patterns in AEM 6Integration patterns in AEM 6
Integration patterns in AEM 6
 
AEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep DiveAEM Rich Text Editor (RTE) Deep Dive
AEM Rich Text Editor (RTE) Deep Dive
 
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
 

Destacado

Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)
Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)
Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)Carsten Ziegeler
 
AEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentAEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentGabriel Walt
 
Adobe Experience Manager - Replication deep dive
Adobe Experience Manager - Replication deep diveAdobe Experience Manager - Replication deep dive
Adobe Experience Manager - Replication deep divemwmd
 
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017Smart Interpretation - Fast AEM Modelling - SAGEEP 2017
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017Torben Bach
 
Scala for scripting
Scala for scriptingScala for scripting
Scala for scriptingday
 
Scala4sling
Scala4slingScala4sling
Scala4slingday
 
Bombardier adobe aem msm implementation
Bombardier adobe aem msm implementationBombardier adobe aem msm implementation
Bombardier adobe aem msm implementationKen Knitter
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
 
What's cool in the new and updated OSGi Specs
What's cool in the new and updated OSGi SpecsWhat's cool in the new and updated OSGi Specs
What's cool in the new and updated OSGi SpecsCarsten Ziegeler
 
What's cool in the new and updated OSGi specs
What's cool in the new and updated OSGi specsWhat's cool in the new and updated OSGi specs
What's cool in the new and updated OSGi specsCarsten Ziegeler
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleCarsten Ziegeler
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGiCarsten Ziegeler
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment6D Global
 
Hubot + Slack + AEM
Hubot + Slack + AEMHubot + Slack + AEM
Hubot + Slack + AEMMax Barrass
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
User interface customization for aem6 circuit
User interface customization for aem6 circuitUser interface customization for aem6 circuit
User interface customization for aem6 circuitDamien Antipa
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingCarsten Ziegeler
 
UI Customization in AEM 6.0
UI Customization in AEM 6.0UI Customization in AEM 6.0
UI Customization in AEM 6.0Gilles Knobloch
 

Destacado (20)

Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)
Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)
Apache Sling - Distributed Eventing, Discovery, and Jobs (adaptTo 2013)
 
AEM Best Practices for Component Development
AEM Best Practices for Component DevelopmentAEM Best Practices for Component Development
AEM Best Practices for Component Development
 
Adobe Experience Manager - Replication deep dive
Adobe Experience Manager - Replication deep diveAdobe Experience Manager - Replication deep dive
Adobe Experience Manager - Replication deep dive
 
Sling Dynamic Include
Sling Dynamic IncludeSling Dynamic Include
Sling Dynamic Include
 
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017Smart Interpretation - Fast AEM Modelling - SAGEEP 2017
Smart Interpretation - Fast AEM Modelling - SAGEEP 2017
 
Scala for scripting
Scala for scriptingScala for scripting
Scala for scripting
 
Scala4sling
Scala4slingScala4sling
Scala4sling
 
Bombardier adobe aem msm implementation
Bombardier adobe aem msm implementationBombardier adobe aem msm implementation
Bombardier adobe aem msm implementation
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
What's cool in the new and updated OSGi Specs
What's cool in the new and updated OSGi SpecsWhat's cool in the new and updated OSGi Specs
What's cool in the new and updated OSGi Specs
 
What's cool in the new and updated OSGi specs
What's cool in the new and updated OSGi specsWhat's cool in the new and updated OSGi specs
What's cool in the new and updated OSGi specs
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGi
 
Introducing CQ 5.1
Introducing CQ 5.1Introducing CQ 5.1
Introducing CQ 5.1
 
CQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and DeploymentCQ5 Development Setup, Maven Build and Deployment
CQ5 Development Setup, Maven Build and Deployment
 
Hubot + Slack + AEM
Hubot + Slack + AEMHubot + Slack + AEM
Hubot + Slack + AEM
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
User interface customization for aem6 circuit
User interface customization for aem6 circuitUser interface customization for aem6 circuit
User interface customization for aem6 circuit
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache Sling
 
UI Customization in AEM 6.0
UI Customization in AEM 6.0UI Customization in AEM 6.0
UI Customization in AEM 6.0
 

Similar a Adobe AEM - From Eventing to Job Processing

CIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoCIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoICF CIRCUIT
 
OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022Ofek Shilon
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure DataTaro L. Saito
 
Advanced windows debugging
Advanced windows debuggingAdvanced windows debugging
Advanced windows debuggingchrisortman
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ihor Banadiga
 
Transactional writes to cloud storage with Eric Liang
Transactional writes to cloud storage with Eric LiangTransactional writes to cloud storage with Eric Liang
Transactional writes to cloud storage with Eric LiangDatabricks
 
Apache Sqoop: Unlocking Hadoop for Your Relational Database
Apache Sqoop: Unlocking Hadoop for Your Relational Database Apache Sqoop: Unlocking Hadoop for Your Relational Database
Apache Sqoop: Unlocking Hadoop for Your Relational Database huguk
 
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers Nikita Lipsky
 
Mastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIMastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIGregory GUILLOU
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Lucas Leong
 
Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Alessandra Bilardi
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupRafal Kwasny
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Building reliable apps with cdk
Building reliable apps with cdkBuilding reliable apps with cdk
Building reliable apps with cdkRaphaelManke1
 
Stardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF DatabaseStardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF Databasekendallclark
 
Stardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF DatabaseStardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF DatabaseClark & Parsia LLC
 

Similar a Adobe AEM - From Eventing to Job Processing (20)

EVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
EVOLVE'13 | Enhance | Eventing to job Processing | Carsten ZeiglerEVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
EVOLVE'13 | Enhance | Eventing to job Processing | Carsten Zeigler
 
CIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoCIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can Do
 
OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022
 
[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Advanced windows debugging
Advanced windows debuggingAdvanced windows debugging
Advanced windows debugging
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
 
Transactional writes to cloud storage with Eric Liang
Transactional writes to cloud storage with Eric LiangTransactional writes to cloud storage with Eric Liang
Transactional writes to cloud storage with Eric Liang
 
Apache Sqoop: Unlocking Hadoop for Your Relational Database
Apache Sqoop: Unlocking Hadoop for Your Relational Database Apache Sqoop: Unlocking Hadoop for Your Relational Database
Apache Sqoop: Unlocking Hadoop for Your Relational Database
 
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers
JIT vs. AOT: Unity And Conflict of Dynamic and Static Compilers
 
Mastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIMastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCI
 
Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...Make static instrumentation great again, High performance fuzzing for Windows...
Make static instrumentation great again, High performance fuzzing for Windows...
 
Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetup
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
 
Building reliable apps with cdk
Building reliable apps with cdkBuilding reliable apps with cdk
Building reliable apps with cdk
 
Stardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF DatabaseStardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF Database
 
Stardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF DatabaseStardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF Database
 

Más de Carsten Ziegeler

Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGiCarsten Ziegeler
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content RepositoriesCarsten Ziegeler
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGiCarsten Ziegeler
 
JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)Carsten Ziegeler
 
Apache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTApache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTCarsten Ziegeler
 
Apache Sanselan (ApacheCon US 2007 FFT)
Apache Sanselan (ApacheCon US 2007 FFT)Apache Sanselan (ApacheCon US 2007 FFT)
Apache Sanselan (ApacheCon US 2007 FFT)Carsten Ziegeler
 
Apache iBatis (ApacheCon US 2007)
Apache iBatis (ApacheCon US 2007)Apache iBatis (ApacheCon US 2007)
Apache iBatis (ApacheCon US 2007)Carsten Ziegeler
 
JCR In Action (ApacheCon US 2007)
JCR In Action (ApacheCon US 2007)JCR In Action (ApacheCon US 2007)
JCR In Action (ApacheCon US 2007)Carsten Ziegeler
 
Apache Portals Panel (ApacheCon US 2007)
Apache Portals Panel (ApacheCon US 2007)Apache Portals Panel (ApacheCon US 2007)
Apache Portals Panel (ApacheCon US 2007)Carsten Ziegeler
 
JCR In Action (ApacheCon EU 2008)
JCR In Action (ApacheCon EU 2008)JCR In Action (ApacheCon EU 2008)
JCR In Action (ApacheCon EU 2008)Carsten Ziegeler
 
Maven SCR Plugin (ApacheCon EU 2008 - FFT)
Maven SCR Plugin (ApacheCon EU 2008 - FFT)Maven SCR Plugin (ApacheCon EU 2008 - FFT)
Maven SCR Plugin (ApacheCon EU 2008 - FFT)Carsten Ziegeler
 

Más de Carsten Ziegeler (12)

Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content Repositories
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGi
 
JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)JCR In Action (ApacheCon US 2009)
JCR In Action (ApacheCon US 2009)
 
Apache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and RESTApache Sling : JCR, OSGi, Scripting and REST
Apache Sling : JCR, OSGi, Scripting and REST
 
Embrace OSGi
Embrace OSGiEmbrace OSGi
Embrace OSGi
 
Apache Sanselan (ApacheCon US 2007 FFT)
Apache Sanselan (ApacheCon US 2007 FFT)Apache Sanselan (ApacheCon US 2007 FFT)
Apache Sanselan (ApacheCon US 2007 FFT)
 
Apache iBatis (ApacheCon US 2007)
Apache iBatis (ApacheCon US 2007)Apache iBatis (ApacheCon US 2007)
Apache iBatis (ApacheCon US 2007)
 
JCR In Action (ApacheCon US 2007)
JCR In Action (ApacheCon US 2007)JCR In Action (ApacheCon US 2007)
JCR In Action (ApacheCon US 2007)
 
Apache Portals Panel (ApacheCon US 2007)
Apache Portals Panel (ApacheCon US 2007)Apache Portals Panel (ApacheCon US 2007)
Apache Portals Panel (ApacheCon US 2007)
 
JCR In Action (ApacheCon EU 2008)
JCR In Action (ApacheCon EU 2008)JCR In Action (ApacheCon EU 2008)
JCR In Action (ApacheCon EU 2008)
 
Maven SCR Plugin (ApacheCon EU 2008 - FFT)
Maven SCR Plugin (ApacheCon EU 2008 - FFT)Maven SCR Plugin (ApacheCon EU 2008 - FFT)
Maven SCR Plugin (ApacheCon EU 2008 - FFT)
 

Último

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Último (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Adobe AEM - From Eventing to Job Processing

  • 1. FROM EVENTING TO JOB PROCESSING Carsten Ziegeler | Adobe Research Switzerland 1
  • 2. 2 •  RnD Team at Adobe Research Switzerland •  Co-founder Adobe Granite •  OSGi Core Platform and Enterprise Expert Groups •  Member of the ASF •  Current PMC Chair of Apache Sling •  Apache Sling, Felix, ACE •  Conference Speaker •  Technical Reviewer •  Article/Book Author cziegele@adobe.com @cziegeler ABOUT
  • 3. 3 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing
  • 4. 4 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing
  • 5. 5 OSGI EVENT ADMIN Publish / Subscribe Model OSGi Event Admin Component A publish deliver Component X Component Y
  • 6. 6 •  OSGi event is a data object with •  Topic (hierarchical namespace) •  Properties (key-value-pairs) •  Page Event •  Topic: com/day/cq/wcm/core/page •  Properties: path, change type (add/remove/edit) etc. OSGI EVENT ADMIN Publish / Subscribe Model
  • 7. 7 •  Publisher creates event object •  Sends event through EventAdmin service •  Either sync or async delivery •  Subscriber is an OSGi service (EventHandler) •  Service registration properties •  Interested topic(s) •  com/day/cq/wcm/core/* •  Additional filters (optional) •  (type="add“) OSGI EVENT ADMIN Publish / Subscribe Model
  • 8. 8 •  Immediate delivery to available subscribers •  No guarantee of delivery •  No distributed delivery OSGI EVENT ADMIN Publish / Subscribe Model
  • 9. 9 •  Immediate delivery to available subscribers •  No guarantee of delivery •  No distributed delivery OSGI EVENT ADMIN Publish / Subscribe Model DiscoverySling Job Distribution
  • 10. 10 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 11. 11 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution New in 5.6.1
  • 13. 13 Instance: Unique Id (Sling ID) TOPOLOGIES I Apache Sling Discovery Clustered CRXCRX ID : A ID : X ID : 42ID : 1 Single Instance Instance 1 Instance 2 Instance 3
  • 14. 14 •  Instance: Unique Id (Sling ID) •  Cluster: Unique Id and leader TOPOLOGIES I Apache Sling Discovery Cluster 99Cluster 35 Clustered CRXCRX ID : A ID : X ID : 42ID : 1 Single Instance Instance 1 Instance 2 Instance 3 Leader Leader
  • 15. 15 •  Topology: Set of clusters TOPOLOGIES I Apache Sling Discovery Cluster 99Cluster 35 Clustered CRXCRX ID : A ID : X ID : 42ID : 1 Single Instance Instance 1 Instance 2 Instance 3 Leader Leader TopologyTopology •  Instance: Unique Id (Sling ID) •  Cluster: Unique Id and leader
  • 16. 16 TOPOLOGIES I Apache Sling Discovery •  Instance: Unique Id (Sling ID) •  Cluster: Unique Id and leader •  Topology: Set of clusters Cluster 99 Clustered CRXCRX ID : A ID : X ID : 42ID : 1 Single Instance Instance 1 Instance 2 Instance 3 Leader Topology Cluster 35 Leader
  • 17. Cluster 99 17 •  Instance •  Sling ID •  Optional: Name and description •  Belongs to a cluster •  Might be the cluster leader •  Additional properties which are distributed •  Extensible through own services (PropertyProvider) •  E.g. data center, region or enabled job topics •  Cluster •  Elects (stable) leader •  Stable instance ordering •  TopologyEventListener: receives events on topology changes TOPOLOGIES II Apache Sling Discovery ID : 42 Instance 3 Topology Leader
  • 18. 18 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 19. 19 •  Job : Guaranteed processing, exactly once •  Exactly one job consumer •  Started by client code, e.g. for replication, workflow... •  Job topic •  Payload is a serializable map JOB HANDLING I Apache Sling Job Handling
  • 20. 20 •  Sling Job Manager handles and distributes jobs •  Delivers job to a job consumer… •  …and waits for response •  Retry and failover •  Notification listeners (fail, retry, success) JOB HANDLING I Apache Sling Job Handling
  • 21. 21 STARTING / PROCESSING A JOB I Apache Sling Job Handling public interface JobConsumer { String PROPERTY_TOPICS = "job.topics"; enum JobResult { OK, FAILED, CANCEL, ASYNC } JobResult process(Job job); } public interface JobManager { Job addJob(String topic, String optionalName, Map<String, Object> properties); … } Starting a job Processing a job Note: Starting/processing of jobs through Event Admin is deprecated but still supported New in 5.6.1
  • 22. 22 @Component @Service(value={JobConsumer.class}) @Property(name=JobConsumer.PROPERTY_TOPICS, value="org/apache/sling/jobs/backup") public class BackupJobConsumer implements JobConsumer { @Override public JobResult process(final Job job) { // do backup return JobResult.OK; } } STARTING / PROCESSING A JOB II Apache Sling Job Handling New in 5.6.1
  • 23. 23 •  New jobs are immediately persisted (resource tree / repository) •  Jobs are “pushed” to the processing instance •  Processing instances use different queues •  Associated with job topic(s) •  Main queue •  0..n custom queues •  For example: replication agent queue or workflow queue JOB HANDLING II Apache Sling Job Handling
  • 24. 24 •  Queue is configurable •  Queue is started on demand in own thread •  And stopped if unused for some time •  Types •  Ordered queue (eg replication) •  Parallel queues: Plain and Topic Round Robin (eg workflow) •  Limit for parallel threads per queue •  Number of retries (-1 = endless) •  Retry delay •  Thread priority JOB QUEUE Apache Sling Job Handling
  • 25. 25 •  Job Manager Configuration = Main Queue Configuration •  Maximum parallel jobs (15) •  Retries (10) •  Retry Delay •  Eventing Thread Pool Configuration •  Used by all queues •  Pool size (35) = Maximum parallel jobs for a single instance ADDITIONAL CONFIGURATIONS Apache Sling Job Handling
  • 26. 26 MONITORING – WEB CONSOLE Apache Sling Job Handling
  • 27. 27 MONITORING – WEB CONSOLE Apache Sling Job Handling
  • 28. 28 •  Each instance determines enabled job topics •  Derived from Job Consumers (new API required) •  Can be whitelisted/blacklisted (in Job Consumer Manager) •  Announced through Topology •  Job Distribution depends on enabled job topics and queue type •  Potential set of instances derived from topology (enabled job topics) •  Ordered : processing on leader only, one job after the other •  Parallel: Round robin distribution on all potential instances •  Local cluster instances have preference •  Failover •  Instance crash: leader redistributes jobs to available instances •  Leader change taken into account •  On enabled job topics changes: potential redistribution JOB DISTRIBUTION Apache Sling Job Handling
  • 29. 29 •  Scalability in AEM: •  DAM Ingestion •  Non-Clustered installation requirement •  The term Offloading: •  In AEM used for all things job distribution and topology in clustered and non- clustered installations, e.g. ‘Offloading Browser’ •  More technically it’s ‘only’ a little add-on in Granite to Sling Job Distribution for handling non-clustered installations WHY OFFLOADING
  • 30. 30 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 31. 31 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 32. 32 SLING JOB DISTRIBUTION Topology Instance Sling ID: 1 Job Manager Instance Sling ID: 2 Job Manager Instance Sling ID: 3 Job Manager Instance Sling ID: 4 Job Manager Job Consumer Topic: A Job Consumer Topic: B Job Consumer Topic: C
  • 33. 33 SLING JOB DISTRIBUTION Instance Sling ID: 1 Job Manager Instance Sling ID: 2 Job Manager Instance Sling ID: 3 Job Manager Instance Sling ID: 4 Job ManagerA Job Consumer Topic: A Job Consumer Topic: B A:2 Job Consumer Topic: CJob Topology
  • 34. 34 SLING JOB DISTRIBUTION Instance Sling ID: 1 Job Manager Instance Sling ID: 2 Job Manager Instance Sling ID: 3 Job Manager Instance Sling ID: 4 Job ManagerB Job Consumer Topic: A Job Consumer Topic: B B:3 Job Consumer Topic: CJob Topology
  • 35. 35 SLING JOB DISTRIBUTION Instance Sling ID: 1 Job Manager Instance Sling ID: 2 Job Manager Instance Sling ID: 3 Job Manager Instance Sling ID: 4 Job ManagerC Job Consumer Topic: A Job Consumer Topic: B C:4 Job Consumer Topic: CJob ? Topology
  • 36. 36 SLING JOB DISTRIBUTION Instance Sling ID: 1 Job Manager Instance Sling ID: 2 Job Manager Instance Sling ID: 3 Job Manager Instance Sling ID: 4 Job ManagerC Job Consumer Topic: A Job Consumer Topic: B C:4 Job Consumer Topic: CJob Offloading Framework Topology
  • 37. 37 •  Detects offloading jobs •  Transport of job and job payload between origin and target instance •  Uses replication for the transport •  No distribution of jobs •  No execution of jobs OFFLOADING FRAMEWORK Overview Instance Sling ID: 1 Job Manager Offloading Job Manager C:4 Instance Sling ID: 4 Job Manager Job Consumer Topic: C Offloading Job Manager C:4 C Job Replication 1 2 3 5 4 6 7 Topology
  • 38. 38 •  Replication agents are created automatically •  Uses naming convention •  Needs manual adjustments (replication user) OFFLOADING FRAMEWORK Replication Worker Sling ID: 4 Author Sling ID: 1 offloading_4 (outgoing agent) offloading_reverse_4 (reverse agent) offloading_outbox (outbox agent)
  • 39. 39 •  Additional properties required •  Offloading job input •  Property: OffloadingJobProperties. INPUT_PAYLOAD (offloading.input.payload) •  Offloading job output •  Property: OffloadingJobProperties. OUTPUT_PAYLOAD (offloading.output.payload) •  Takes comma separated list of paths •  Used to build the replication package •  Job sender needs to set these properties for offloading to work! OFFLOADING FRAMEWORK Job Payload
  • 40. 40 •  Configures Job Consumers •  Configures the topic white/black listing properties of each instance •  What jobs to execute on what instance •  Configures the distribution •  Configuration applies for both, clustered and non-clustered installations OFFLOADING BROWSER UI
  • 44. 44 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 45. 45 •  New JobConsumer •  Class: WorkflowOffloadingJobConsumer •  Topic: com/adobe/granite/workflow/offloading •  Can launch new workflows •  Expects the workflow model on the job payload •  Expects the workflow payload on the job payload •  For use with clustered and non-clustered installations WORKFLOW DISTRIBUTION
  • 46. 46 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified)
  • 47. 47 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified) •  Define the job topic
  • 48. 48 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified) •  Create service component •  Must register with topic •  Implement new JobConsumer interface
  • 49. 49 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified) •  Access job properties (payload) •  Read workflow model and payload from job properties
  • 50. 50 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified) •  Workflow specific •  Use workflow API to start workflow for the given model and payload
  • 51. 51 @Component @Service @Property(name = JobConsumer.PROPERTY_TOPICS, value = WorkflowOffloadingJobConsumer.TOPIC) public class WorkflowOffloadingJobConsumer implements JobConsumer { public static final String TOPIC = "com/adobe/granite/workflow/offloading"; public static final String WORKFLOW_OFFLOADING_MODEL = "offloading.workflow.model"; public static final String WORKFLOW_OFFLOADING_PAYLOAD = "offloading.workflow.payload”; public JobResult process(Job job) { // read workflow model and payload from job payload String modelPath= job.getProperty(WORKFLOW_OFFLOADING_MODEL , ""); String payloadPath= job.getProperty(WORKFLOW_OFFLOADING_PAYLOAD , ""); // get/create WorkflowSession, WorkflowModel and WorkflowData objects WorkflowSession wfSession = ..; WorkflowModel wfModel = ..; WorkflowData wfData = ..; // start the workflow wfSession.startWorkflow(wfModel, wfData, metaData); // all good return JobResutl.OK; } } WORKFLOW DISTRIBUTION Job Consumer (Simplified) •  Use JobResult enumeration to report back the job status
  • 52. 52 OVERVIEW Where to fit in the stack Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 53. 53 •  Default ingestion workflow: “DAM Update Asset” •  Load is put on the instance where the workflow is started, usually the author •  New ingestion workflow: “DAM Update Asset Offloading” •  Needs to be manually enabled by changing the workflow launcher •  New workflow model with a single step: AssetOffloadingProcess •  Uses WorkflowExternalProcess API •  Creates a new job on topic: com/adobe/granite/workflow/offloading •  Allows distributing the default ingestion workflow •  Load is put on the instance where the job is distributed to •  Can be used to distribute in clustered and non-clustered installations DAM INGESTION
  • 54. 54 @Component @Service public class AssetOffloadingProcess implements WorkflowExternalProcess { @Reference private JobManager jobManager; private static final String TOPIC = "com/adobe/granite/workflow/offloading"; public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step)
  • 55. 55 @Component @Service public class AssetOffloadingProcess implements WorkflowExternalProcess { @Reference private JobManager jobManager; private static final String TOPIC = "com/adobe/granite/workflow/offloading"; public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step) •  Create service component •  Implement WorkflowExternalProcess interface •  Reference JobManager service
  • 56. 56 @Component @Service public class AssetOffloadingProcess implements WorkflowExternalProcess { @Reference private JobManager jobManager; private static final String TOPIC = "com/adobe/granite/workflow/offloading"; public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step) •  DAM and Workflow specific •  Resolve to Asset •  Read model from meta data •  Read workflow payload from Asset path
  • 57. 57 public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step) •  ValueMap for job properties •  Put model and payload on job properties •  Used by the JobConsumer
  • 58. 58 public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step) •  Build offloading payload properties •  Comma separated list of paths •  Put them on the job payload as well •  Only used for non-clustered distribution
  • 59. 59 public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ Asset asset = ..; String workflowModel = “/etc/workflow/models/dam/update_asset/jcr:content/model”; String workflowPayload = “/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg”; ValueMap jobProperties = new ValueMapDecorator(new HashMap<String, Object>()); jobProperties.put(WORKFLOW_OFFLOADING_MODEL, workflowModel); jobProperties.put(WORKFLOW_OFFLOADING_PAYLOAD, workflowPayload); String offloadingInput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; String offloadingOutput = “/etc/workflow/models/dam/update_asset/jcr:content/model, /content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg” ; jobProperties.put(OffloadingJobProperties.INPUT_PAYLOAD.propertyName(), offloadingInput); jobProperties.put(OffloadingJobProperties.OUTPUT_PAYLOAD.propertyName(), offloadingOutput); Job offloadingJob = jobManager.addJob(TOPIC, null, jobProperties); return offloadingJob.getId(); } DAM INGESTION Create Job (from workflow step) •  Create job using JobManager service •  Use topic from job consumer •  Put job payload properties •  Return the jobId as the workflow process id (workflow specific)
  • 60. 60 @Component @Service public class AssetOffloadingProcess implements WorkflowExternalProcess { @Reference private JobManager jobManager; private static final String TOPIC = "com/adobe/granite/workflow/offloading"; public Serializable execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap){ …. } public boolean hasFinished(Serializable externalProcessId, ..){ // returns null, if job is finished Job offloadingJob = jobManager.getJobById((String) externalProcessId); return offloadingJob == null; } } DAM INGESTION Create Job (from workflow step) •  Workflow API specific callback •  Process id = jobId, from execute() •  Query job by jobId •  Workflow step finished when job is finished
  • 61. 61 •  Choose a job topic •  Create JobConsumer component and register with topic chosen •  To create a new job use new JobManager.addJob() API with the topic chosen and the job payload •  Add offloading payload to job payload •  Bundle and deploy JobConsumer on topology instances •  Enable/Disable the new topic on the instances, using Offloading Browser DEVELOPMENT - RECIPE
  • 62. 62 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution
  • 63. 63 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution org.apache.sling.discovery.api •  Discovers topology •  Cross-Cluster detection •  Foundation for job distribution
  • 64. 64 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution org.apache.sling.event •  Uses Sling Discovery •  New JobConsumer API and job topics •  New JobManager API for creating new distributed jobs •  Distributes jobs based on available job topics and job queue configuration. •  Distributes in the whole topology, including clustered and non- clustered instances •  Can execute cluster local jobs only
  • 65. 65 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution com.adobe.granite.offloading.core •  Builds on top of Sling Distributed Jobs •  Does not perform distribution •  Detects jobs distributed to non-clustered instances •  Transports the jobs and payload to non-clustered instances •  Uses replication for transport •  Does not execute jobs
  • 66. 66 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution com.adobe.granite.workflow.core •  Defines a job consumer to distribute the execution of whole workflows •  Defines topic com/adobe/granite/workflow/ offloading •  Implements WorkflowOffloadingJobConsumer component •  Supports clustered and non clustered installations
  • 67. 67 TAKE AWAY Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution cq-dam-core •  Makes use of com/adobe/granite/workflow/ offloading topic from Workflow Distribution •  New workflow step (external step) that creates a new job on topic com/adobe/granite/workflow/ offloading •  New “DAM Update Asset Offloading” workflow •  Supports clustered and non clustered configurations
  • 68. 68 TAKE AWAY Potential Future Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing
  • 69. 69 TAKE AWAY Potential Future Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing New OSGi Specification • Distributed Eventing • Cloud Computing
  • 70. 70 TAKE AWAY Potential Future Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing Job Distribution • Improved load balancing • Pull based distribution
  • 71. 71 TAKE AWAY Potential Future Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing Offloading • As part of job distribution • Even simpler setup
  • 72. 72 TAKE AWAY Questions? Discovery Offloading Workflow Distribution DAM Ingestion Sling Granite AEM Job Distribution Felix OSGi Event Admin FromEventingtoJobProcessing
  • 73. 73