Adobe Experience Manager - Replication deep dive

25
CIRCUIT – An Adobe Developer Event Presented by CITYTECH, Inc. AEM Replication deep dive Matthias Wermund Acquity Group part of Accenture Interactive

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

Page 1: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

AEM Replicationdeep dive

Matthias WermundAcquity Group

part of Accenture Interactive

Page 2: Adobe Experience Manager - Replication deep dive

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

Page 3: Adobe Experience Manager - Replication deep dive

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

Page 4: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Types of replication

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

• Reverse replication

Page 5: Adobe Experience Manager - Replication deep dive

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

Page 6: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Ways to trigger replication

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

Page 7: Adobe Experience Manager - Replication deep dive

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

Page 8: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Publishing workflow

Page 9: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Custom workflow process step

1

2

3

Page 10: Adobe Experience Manager - Replication deep dive

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

Page 11: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Replication event listener

1

2

Page 12: Adobe Experience Manager - Replication deep dive

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

Page 13: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Advanced publishing workflow

Page 14: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Synchronous replication with listener

1

2

Page 15: Adobe Experience Manager - Replication deep dive

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

Page 16: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Custom ReplicationContentFilter1

2

Page 17: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ReplicationContentFilterFactory

Page 18: Adobe Experience Manager - Replication deep dive

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

Page 19: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ContentBuilder implementation (1/2)

1

2

Page 20: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

ContentBuilder implementation (2/2)

3

4

Page 21: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

JSON replication agent

Page 22: Adobe Experience Manager - Replication deep dive

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

Page 23: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Configure agent with user account

Page 24: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Setup ACL for single site

Page 25: Adobe Experience Manager - Replication deep dive

CIRCUIT – An Adobe Developer EventPresented by CITYTECH, Inc.

Thanks

• Questions?

[email protected]/mwmd