Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

How to configure replication agent based on run modes in AEM?

Avatar

Level 2

I need to configure a replication agent based on tun modes, such as dev, sit and staging.

How can we implement this in a simple way in AEM?

Is it possible to use a folder structure similar to OSGI configuration? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Nesan 
Please check this https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/replication-agent-config-g...

 

 

Create runmodes for each instance that combine the values I need, for example, my dev servers have:

  • publish, dev, d, publish-dev
  • author, dev, d, author-dev

And then I have to use the hyphenated value in my replication agents.

  • /etc/replication/agents.author-dev
  • /etc/replication/agents.publish-de


Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Nesan 
Please check this https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/replication-agent-config-g...

 

 

Create runmodes for each instance that combine the values I need, for example, my dev servers have:

  • publish, dev, d, publish-dev
  • author, dev, d, author-dev

And then I have to use the hyphenated value in my replication agents.

  • /etc/replication/agents.author-dev
  • /etc/replication/agents.publish-de


Arun Patidar

Avatar

Community Advisor

Hi @Nesan ,

Yes, it is possible to configure a replication agent based on run modes in AEM using a folder structure similar to OSGi configuration.

Here's a simple way to implement this:

1. Create a folder structure under `/apps` in your AEM instance to store the replication agent configurations based on run modes. For example:
```
/apps/myproject/config.publish.dev
/apps/myproject/config.publish.sit
/apps/myproject/config.publish.staging
```

2. Under each run mode folder, create a sling:OsgiConfig node with the desired replication agent configuration. For example, create a node named `com.day.cq.replication.impl.ReplicationAgentImpl-myagent.config` with the necessary properties.

3. In each run mode folder, create a `sling:OsgiConfig` node named `org.apache.sling.installer.api.tasks.ResourceTransformer.config` with the following properties:
- `service.ranking` (Integer): Set a higher value for the run mode you want to prioritize. For example, set a higher value for `config.publish.staging` if you want it to take precedence over other run modes.
- `resource.processing.priority` (Integer): Set a higher value for the run mode you want to prioritize.

4. Restart your AEM instance for the changes to take effect.

With this setup, AEM will automatically pick up the appropriate replication agent configuration based on the active run mode. The configuration under the run mode with the highest `service.ranking` value will be used.

Note: Make sure to adjust the folder structure and configuration names according to your project's needs.