AEM Cloud Service Content Distribution
Beta Skill: This skill is in beta and under active development. Results should be reviewed carefully before use in production. Report issues at https://github.com/adobe/skills/issues
Programmatic content publishing and distribution monitoring using official AEM Cloud Service APIs.
When to Use This Skill
Use this skill collection for:
- Programmatic publishing: Publish content via
ReplicatorAPI - Distribution monitoring: Track distribution lifecycle events
- Automated workflows: Integration with workflow process steps
- Event handling: React to distribution events (failures, completions)
- Custom publishing logic: Bulk operations, Preview tier publishing
Sub-Skills
This is a parent skill that routes to specialized sub-skills based on your task:
Quick Decision Guide
Choose Replication API when you need to:
- Publish content from custom OSGi services
- Integrate publishing into workflow steps
- Perform bulk publishing operations
- Publish to Preview tier for review
- Check replication status programmatically
Choose Sling Distribution Events when you need to:
- Monitor distribution lifecycle (created, queued, distributed, imported)
- React to distribution failures
- Trigger post-distribution actions (cache warming, notifications)
- Audit distribution operations
- Track distribution metrics
Official APIs
Both skills use official, supported AEM Cloud Service APIs:
-
Replication API:
com.day.cq.replication- Javadoc: https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/com/day/cq/replication/package-summary.html
- Main Classes:
Replicator,ReplicationOptions,ReplicationStatus,ReplicationActionType
-
Sling Distribution API:
org.apache.sling.distribution- Javadoc: https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/org/apache/sling/distribution/package-summary.html
- Main Packages:
org.apache.sling.distribution.event(event topics and properties)
Architecture Overview
How It Works
- Your code calls
Replicator.replicate()to publish content - Sling Distribution packages content and fires
AGENT_PACKAGE_CREATEDevent - Package is queued and
AGENT_PACKAGE_QUEUEDevent fires - Package is sent to Adobe Developer pipeline and
AGENT_PACKAGE_DISTRIBUTEDevent fires - Target tier imports content and
IMPORTER_PACKAGE_IMPORTEDevent fires - Content is live on target tier (Publish or Preview)
Common Patterns
Pattern 1: Publish and Monitor
Publish content and track when it goes live:
Pattern 2: Preview-First Workflow
Publish to Preview for approval, then to Publish:
Pattern 3: Auto-Publish with Failure Handling
Auto-publish content and alert on failures:
Rate Limits and Constraints
Note:
ReplicationOptions.setUseAtomicCalls()is@Deprecated/ "no longer required" per the Cloud Service Javadoc — the system handles auto-bucketing automatically for >100 paths.
Best Practice: For large hierarchical content trees, use the Tree Activation workflow step instead of custom code.
Key Differences from AEM 6.x
When NOT to Use These Skills
Use UI workflows instead when:
- Publishing small amounts of content manually
- One-off publishing operations
- Content authors can use Quick Publish or Manage Publication
Use Tree Activation workflow when:
- Publishing large hierarchical content trees
- Bulk operations across hundreds of paths and no custom logic is needed
Quick Reference
Replication API Basics
Distribution Event Handling Basics
Best Practices
- Use the right API: Replication API for publishing, Distribution events for monitoring
- Respect rate limits: ≤100 paths for transactional guarantee
- Handle failures: Always catch
ReplicationException, monitorAGENT_PACKAGE_DROPPEDevents - Use service users: Never use admin credentials
- Filter events appropriately: Only listen to events you need
- Validate permissions: Call
replicator.checkPermission()before replication - Publish only what's needed: Avoid unnecessary bulk operations
Troubleshooting
Replication Issues
Event Handling Issues
Detailed Documentation
For detailed examples, code samples, and advanced usage:
- Replication API: See replication/SKILL.md
- Sling Distribution Events: See sling-distribution/SKILL.md
References
- Replication Javadoc: https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/com/day/cq/replication/package-summary.html
- Sling Distribution Javadoc: https://developer.adobe.com/experience-manager/reference-materials/cloud-service/javadoc/org/apache/sling/distribution/package-summary.html
- Adobe Documentation: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/replication.html
- Sling Distribution: https://sling.apache.org/documentation/bundles/content-distribution.html
- Service Users / Repo Init: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/aem-project-content-package-structure#repo-init
