April 2, 2020
Estimated Post Reading Time ~

How to configure replication agent to specific site content

Introduction

 Frequently came across a lot of questions on how to configure replication agents to target site-specific content.  The OOB cq/AEM agent configuration as an option called "Agent User Id" Which can be used as a mechanism for selecting specific content for replication. More details and clearly explained at [1].   In this blog, I am describing one such example which might help to get started.

Scenario 

Assume you have one author instance namely author and two publish instances namely publish1 & publish2.  The contents activated for site "/content/geometrixx/en" should get replicated only to publish1 and similarly contents activated for site "/content/geometrixx/de" should get replicated only to publish2.

Solution

You need to follow three simple steps mentioned below for each site.
  1. Create a user.
  2. Assign permissions for user-created at step1 to read site-specific content that will be activated.
  3. Configure replication agent and in the replication agent for "Agent User Id" assign userid created in step1.

Demo Time

Environment:-  There are three local instances running
  • author at port 4502
  • publish1 at port 4503
  • publish2 at port 4555
Configure Instance:-  First configure for site "/content/geometrixx/en" by following steps mentioned at "Solution" section.
  • Create an user let us say "onlyen" at http://<host>:<port>/useradmin -> Create -> Create User.
  • Assign permission to "onlyen" to read site-specific content "/content/geometrixx/en"
  •  Configure replication agent publish and assign "Agent User Id"as "onlyen"

Similarly configure for site "/content/geometrixx/de" by following steps mentioned at "Solution" section. Snapshots below

Verify the configuration

  • Create a page "testen" at "/content/geometrixx/en".
  • Similarly create another page "testde" at "/content/geometrixx/de".
  • Activate the pages "testen" & "testde".
  • Go to each publish instance & verify "testde" does not exist at 4503. Similarly, "testen" does not exist in 4555.

Q&A

The userid "onlyen", "onlyde" does not exist in publish instances. How will replication work?
To replicate content to publish instance it uses the credential mentioned at the transport section and not "Agent User Id". Both user ids are different. The one in transport used to connect publish instance while "Agent User Id" is used to read content that will be activated.

Is there a scenario if we need to do similar steps on publish instance?
It depends on a case by case OR on your architecture.  Generally, you might need to configure in publish also if you are using single publish instance & separate webserver for each site Or other scenario.

Is there any additional permission needs to be granted in publish instance for user-id used for "Agent User Id"?
For an agent on the publish environment this account must have the create/write access required to replicate the content.

Will all replication agents gets called when activating a content?
Yes, Every replication agent is invoked. Only the agent that has read access to the content gets replicated.

Reference

[1]   http://dev.day.com/docs/en/cq/current/deploying/replication.html
[2]   http://helpx.adobe.com/cq/kb/CQ5ReplicateToSpecificAgents.html
[3]   https://helpx.adobe.com/cq/kb/HowToFlushAssetsPublish.html


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.