ADOBE EXPERIENCE MANAGER (AEM) EXAMS

AEM as a Cloud Service Developer Recertification Study Guide

Adobe Experience Manager (AEM) as a Cloud Service Developer Recertification Exam Study Guide.

SDK

AEM as a Cloud Service artifacts.

  • Quickstart jar - AEM runtime used for local development
  • Dispatcher Tools - Caching and/or load balancing tool
  • Java API jar - Exposes all allowed Java API’s that can be used for development with AEM as a Cloud Service. Formerly referred to as the Uberjar.
  • Javadoc jar - Support doc for Java API jar

Project Structure

For a detailed chart with more information, this up to date Maven Project Structure Flow Chart can be referenced.

Project Structure

Mutable and Immutable Content

AEM as a Cloud Service requires a separation of content and code. A single content package cannot deploy to both /apps and runtime-writable mutable areas like /content/conf/home, or anything not /apps, /libs or /oak:index. Any attempt to change an immutable area at runtime will fail.

Mutable areas include /content, /conf, which can be changed at runtime.

Code (immutable) packages pom.xml must configure its package type as application, e.g., <packageType>application</packageType>.

Content (mutable) packages pom.xml must configure its package type as content. e.g., <packageType>content</packageType>.

/libs should not be modified. Only AEM product code may deploy to /libs.

Unlike a local AEM solution, code is never directly deployed to an AEM instance. This ensures that the code running for a given reason in any cloud environment is identical. This eliminates the risk of unintentional code variation on production environments.

AEM Project Structure

Repository Structure Package

To prevent a code package from installing over another, its pom.xml FileVault Maven plug-in settings should reference a <repositoryStructurePackage> that enforces correctness of structural dependencies.

ui.apps/pom.xml

This is only required for Code packages, e.g., any package marked with <packageType>application</packageType>.

Merging Projects for Deployment

For deployment to to AEM as a Cloud Service using Cloud Manager, a single git repository is required.

Here is a typical project structure for multiple projects. Note that there is only one dispatcher sub project. This is the result of merging it from each sub project into a single dispatcher sub project in the root.

  • com.adobe.aem
    • dispatcher
      • pom.xml
      • src
    • pom.xml
    • projectA
      • core
      • ui.apps
      • ui.content
      • pom.xml
    • projectB
      • core
      • ui.apps
      • ui.content
      • pom.xml

Project Merge

Merging AEM projects for deployment using Cloud Manager

Git

How to add the Cloud Manager git repo as an alias to the customer managed repo. In this example, xyz is the github account for the company managed repo. xyzcm is the customers Cloud Manager account name.

# List remotes for the customer managed repo
git remote -v

# output
origin git@github.com:xyz/somerepo (fetch)
origin git@github.com:xyz/somerepo (push)

# add the Cloud Manager git repo "xyzcm" as a second remote with the alias: `cmrepo`
git remote add cmrepo https://git.cloudmanager.adobe.com/xyzcm/xyzcm

# verify the addition
git remote -v

# output
cmrepo https://git.cloudmanager.adobe.com/xyzcm/xyzcm (fetch)
cmrepo https://git.cloudmanager.adobe.com/xyzcm/xyzcm (push)
origin git@github.com:xyz/somerepo (fetch)
origin git@github.com:xyz/somerepo (push)

Commits can then be pushed to both repos independently from the active branch.

# push to the Cloud Manager git repo master branch
git push cmrepo master

Integrating Git with Adobe Cloud Manager

Content Publishing Process

With AEM as a Cloud Service, the replication framework in previous versions of AEM is no longer used to publish pages. AEM as a Cloud Service uses a Sling Content Distribution framework to distribute to a pipeline service running on Adobe I/O outside of the AEM runtime. A single publish or unpublish request can include multiple resources. A single return status is applied to all, meaning it will either succeed or fail for all resources in AEM publish service. This ensures that the resource within AEM publish service will never be in an inconsistent state.

Content replication is located under ToolsDeploymentDistribution

Content Replication Service

Dispatcher Configuration

The Dispatcher SDK allows customers to run the same validation that Cloud Manager will perform while building and deploying a release.

When making changes to the dispatcher SDK files, do not modify the default* configuration files as they are deemed immutable and should not be changed. To make changes, copy the default or create a new file within the folder and link as needed.

Using the Dispatcher Configuration Validator

This example uses the Windows version of the Dispatcher Tools and performs a full analysis of all the files within the src folder. It generates an output that is stored in the out folder.

cd aem-sdk-dispatcher-tools

bin\validator full -d out src

Set up local Dispatcher Tools
Dispatcher in the Cloud

Convert the Dispatcher Configuration from AMS

Maintenance Tasks

Configured by the Adobe

  • Datastore Garbage Collection
  • Version Purge
  • Audit Log Purge
  • Lucene Binaries Cleanup

Configured by the customer

These configuration changes are stored in the customer’s github source control for deployment.

See the Maintenance Tasks in AEM as a Cloud Service - Maintenance Window Configuration for additional configuration details.

To configure the OSGi properties, see the AEM 6.5 Maintenance Task documentation.

Search Indexing in AEM as a Cloud Service

  • Users will not have access to the Index Manager
  • Users will no longer change indexes on a single AEM instance, nor will they have to worry about consistency checks or re-indexing.
  • Index configuration is changed via deployments

Content Search and Indexing

Log Files

  • Log file tailing is only available using the Adobe I/O CLI
  • Log file download is available with both Cloud Manager or the Adobe I/O CLI

Cloud Manager plugin for the Adobe I/O CLI

Using a command line terminal, navigate to directory where the plugin has been installed. Use the aio cloudmanager:program:list-environments command or its alias, aio cloudmanager:list-environments to list available environments. Note the Environment Id for which you would like to access the logs. e.g.,

aio cloudmanager:list-environments

Environment Id  Name        Type   Description
1234            XYZ Dev     dev    XYZ Dev Environment
1235            XYZ Prod    prod   XYZ Prod Environment
1236            XYZ Stage   stage  XYZ Stage Environment

Then enter the command to list the logs, aio cloudmanager:environment:list-available-log-options or its alias aio cloudmanager:list-available-log-options with the ENVIRONMENTID argument. e.g.,

aio cloudmanager:list-available-log-option 1234

Environment Id  Service     Name
1234            author      aemerror
1234            author      aemrequest
1234            author      aemaccess
1234            publish     aemerror
1234            publish     aemrequest
1234            publish     aemaccess
1234            dispatcher  httpderror
1234            dispatcher  aemdispatcher
1234            dispatcher  httpdaccess

To tail logs, use aio cloudmanager:tail-log or aio cloudmanager:tail-logs with the ENVIRONMENTID, SERVICE and NAME arguments. e.g.,

aio cloudmanager:tail-log 1234 author aemerror

To download logs, use aio cloudmanager:download-logs with the ENVIRONMENTID, SERVICE and NAME arguments. Optionally, specify the number days (default: 1). e.g.,

aio cloudmanager:download-logs 1234 author aemerror

# 2 days
aio cloudmanager:download-logs 1234 author aemerror 2

More info: aio-cli-plugin-cloudmanager

Cloud Manager

Using Cloud Manager, log file can be downloaded for a specific environment. Select either the settings cog or Manage button to access the list of logs available for download for the respective environment.

Development Guidelines

  • Since the code is always running in a cluster, there are always multiple instances running. It must be resilient since an instance may be stopped at any point in time.

  • The Apache Sling Discovery API can be used to identify the primary instance in the cluster.

  • State must not be kept in memory but persisted in the repository.

  • The instance’s file system should not be used in AEM as a Cloud Service. The disk is ephemeral and will be disposed when instances are recycled.

  • With everything that is asynchronously happening like acting on observation events, it cannot be guaranteed to be executed locally and therefore must be used with care.

  • It is best to use the Sling Jobs scheduler as this again the at-least-once execution. The Sling Commons Scheduler should not be used for scheduling as execution cannot be guaranteed.

  • Outgoing HTTP connections should use reasonable connect and read timeouts. By default, AEM as a Cloud Service use global timeouts of 10 seconds for connect calls and 60 seconds for read calls.

  • Adobe recommends the use of the provided Apache HttpComponents Client 4.x library for making HTTP connections.

  • Only the Touch UI is supported for custom code. Classic UI is not available for customization.

  • Streaming Binaries are not allowed through AEM as a Cloud Service. Use a CDN instead to serve binaries outside of the core AEM services. For example, do not use asset.getOriginal().getStream() to trigger downloading of a binary onto the AEM service’s ephemeral disk.

  • Reverse replication from Publish to Author is not supported in AEM as a Cloud Service.

  • CRXDE lite is only available on the author tier’s development environment. It is not available on stage or production since the immutable /libs and /apps repository cannot be written to at runtime.

  • Use the Developer Console for dev, stage, and production environments at https://dev-console/-<namespace>.<cluster>.dev.adobeaemcloud.com. The Cloud Manager CLI command can be used to launch the developer console based on an environment parameter. For example,

aio cloudmanager:open-developer-console <ENVIRONMENTID> --programId <PROGRAMID>

AEM as a Cloud Service Development Guidelines

Miscellaneous Q & A

  1. Where do you to to download software for local development for AEM as a Cloud Service? - Software Distribution Portal

  2. A Quality gate result shows there is a TimeOutException, so what should be done to tweak the code?
    Custom Code Quality Rules - HTTP requests should always have socket and connect timeouts

  3. Select two differences between a production vs non-production pipeline (needs to be verified)

  • Load / performance testing
  • Security testing
  1. How do you check bundles in AEM as a Cloud Service like in AMS using the OSGi console? - Developer Console
    Debugging AEM as a Cloud Service with the Developer Console

  2. How to move existing Dispatcher cache configs to the AEM as a cloud service Dispatcher? - Move the caching rules to its files and include these file paths in dispatcher.any

  3. How are UI unit tests built? - UI Testing
    aem-project-archetype-24/…/ui.tests/test-module

  4. For a minimal project generated by the AEM Project Archetype, which module(s) can be excluded? ui.frontend
    Using the AEM Project Archetype

  5. Dispatcher VHOST updates, copy the *.vhost file or merge it? - Update and copy virtualhosts.any, do not update default_virtualhosts.any

  6. What is the most efficient way to migrate AEM version 6.3 to 6.5?
    Upgrading to AEM 6.5

  7. Sync Users from LDAP to AEM - The User Sync Tool enables enterprise customers to create and manage Adobe users utilizing Active Directory. This also works for other tested OpenLDAP directory services.
    IMS Support for Adobe Experience Manager as a Cloud Service

  8. What git command can be used to sync the AEM as a Cloud Service git repo with a customer managed git repo?
    Working with Multiple Source Git Repositories

  9. For performance reasons, when is the best time to perform a backup? - A certain time frame, such as “during the middle of the night” or “on the weekend” is not specified. Backups are performed in a manner that has no impact on the runtime performance of an application.
    Backup and Restore in AEM as a Cloud Service

  10. What is one of the advantages of a headless implementation? Headless Development for AEM Sites as a Cloud Service

  11. What happens to virtual host sections that do not refer to port 80 in AEM as a Cloud Service dispatcher? - Statements in these sections will not get processed.

November 2019 Version

There have been some changes to the AEM Project Archetype structure since the 2019 version of the AD5-112 exam project structure info below.

This is the project structure for an AEM project that is generated using aem-project-archetype-22 defaults, e.g.,

mvn archetype:generate \
 -DarchetypeGroupId=com.adobe.granite.archetypes \
 -DarchetypeArtifactId=aem-project-archetype \
 -DarchetypeVersion=22
  • com.adobe.aem
    • all
      The all package is a container package that includes the ui.apps and ui.content package as embeds. The all package must not have any content of its own, this package delegates deployment to the jcr from its sub packages.
    • core
      This package creates the OSGi bundle (bundle.jar) from all of the Java code for deployment. This includes the Sling Models.
    • it.launcher
    • it.tests
    • repository-structure
      <repositoryStructurePackage> enforces correctness of structural dependencies to ensure one code package doesn’t install over another. This is only required for code packages, e.g., any package marked with <packageType>application</packageType> in its pom.xml.
    • ui.apps
      The ui.apps package contains all the code that is deployed to the /apps folder in the jcr. This folder can contain OSGi bundles, OSGi configurations, HTL scripts, ACL permissions, etc.
    • ui.content
      The ui.content package contains the content (/content) and configuration (/conf).
    • .gitignore
    • pom.xml
    • README.md

AEM Archetype Project Structure - Archetype 22

Additional Resources from Adobe

Caching in AEM as a Cloud Service
Cloud Manager
Configure and Use Asset Microservices
Deploying to AEM as a Cloud Service
Dispatcher Converter
Operations and Maintenance on Experience Manager as a Cloud Service
Release Notes for AEM as a Cloud Service
Video Series - Understand Adobe Cloud Manager


Part 3 of 3 in the AEM Exam Prep series.

Part 1 | AEM as a Cloud Service Developer Recertification

comments powered by Disqus