Sling Content Distribution in AEM (Part 2) — Reverse Distribution

Опубликовано: 24 Октябрь 2024
на канале: Tech Forum
1,234
10

#AdobeExperienceManager #aem #aemdevelopment

SLING CONTENT DISTRIBUTION - SYNC USER AND CONTENT ON AEM AUTHOR AND PUBLISHERS

Reverse Distribution - Definition
• A reverse distribution setup allows one to transfer content from a farm of source instances(publisher) to a target instance(author).
• That is done by pulling the content from source instances(publisher) into the target instance(author).

Configuration
• configure a “queue” agent and package exporter on the publisher(source instance)

org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json
name="reverse"

org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse
name="reverse"
agent.target="(name=reverse)"

• configure a “reverse" agent on the author(target instance) pointing to the URL of the exporter on the publish server, multiple publisher endpoints can be configured

org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-reverse.json
name="reverse"
packageExporter.endpoints=["@ing/distribution/services/exporters/reverse"]

Demo

• Configure Reverse Agent in Author – UI/OSGI Config
• Configure Queue agent and exporter on Publisher
• Enable Triggers – Scheduled/JCREvent
• Test – CURL/UI/Triggers

curl -u admin:admin @ing/distribution/services/agents/reverse -d "action=ADD" -d "path=/content/we-retail/jcr:content"
curl -u admin:admin @ing/distribution/services/agents/reverse -d "action=PULL"