Adobe Experience Manager - Replication deep dive

Post on 27-Aug-2014

580 views 3 download

Tags:

description

Slides presented at the Circuit14 conference in Chicago 6/4/14. Topic was the replication framework of Adobe Experience Manager (AEM) and how it can get customized to address various use cases. Demonstrated sample code is accessible at GitHub: https://github.com/mwmd/circuit14-aem-replication

Transcript of Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

AEM Replicationdeep dive

Matthias WermundAcquity Group

part of Accenture Interactive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Replication overview

• AEM replication is used for (un)publishing of AEM content

• Most interaction between AEM Author and AEM Publish is part of replication

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Key replication components

• Agent– One per receiving end

• Queue– Tracks replication requests– One per agent

• ContentBuilder– Transforms replicated content to payload

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Types of replication

• Activate / Deactivate– Durbo– Flush– Binary-less– Static

• Reverse replication

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Dispatcher cache flush

• HTTP request to web server module• Effect dependent on dispatcher

configuration– Deletion of activated content– Invalidation of related content (statfileslevel)

• On Author vs. On Publish– Race condition of replication and invalidation– On Publish safer, but not always possible

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Ways to trigger replication

• Page authoring• Tree activation• Workflow• Custom code (API)

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Publication preview

• Before going live to end users, preview of change in internal AEM Publish is required

• Solution approach:– Integration in publishing workflow– Activation to only selected AEM Publish– Review & approve before standard activation

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Publishing workflow

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Custom workflow process step

1

2

3

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Global replication notification

• All replication invocations need to trigger an external search index update

• Solution approach:– Implement OSGi listener for replication events– Get replication metadata from event– Trigger indexing based on replication type

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Replication event listener

1

2

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Guaranteed replication

• Before Author users are asked to review, the activation to Preview Publish must have been successfully completed

• Solution approach:– Use synchronous replication– Verify success via replication listener

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Advanced publishing workflow

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Synchronous replication with listener

1

2

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Data filtering

• For privacy, author user information must get removed from AEM Publish content

• Solution approach:– Create custom content filter implementation– Filter out undesired properties

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Custom ReplicationContentFilter1

2

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ReplicationContentFilterFactory

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Custom replication payload

• When publishing, content must get exported to a 3rd party system in JSON

• Solution approach:– Create a custom ContentBuilder– Invoke standard JSON renderer for page– Send HTTP POST using replication agent

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ContentBuilder implementation (1/2)

1

2

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ContentBuilder implementation (2/2)

3

4

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

JSON replication agent

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Scenario: Content partitioning

• Different sites must get replicated only to dedicated AEM Publish instances

• Solution approach:– Create system user account per site– Configure replication agent with user account– Configure ACL to READ for only one site

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Configure agent with user account

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Setup ACL for single site

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Thanks

• Questions?

matthias.c.wermund@accenture.comgithub.com/mwmd