Can we control the order of replication agents? | Community
Skip to main content
Level 2
May 30, 2018
Solved

Can we control the order of replication agents?

  • May 30, 2018
  • 6 replies
  • 4198 views

We are using AEM 6.3

My use case:

There are totally 3 replication agents in my scenario

1. On author, I have 2 replication agents

2. One for activating the content to publish instance

3. One agent to purge Akamai Cache.

4. On publish there is one replication agent to flush dispactcher cache.

Issue: I want to activate Akamai Cache purge ONLY AFTER flushing dispatcher cache. So on author, can I trigger Akamai Cache Purge Agent only after the content gets activated on Publish instance? Can I do that?

Note:

1. Having the Akamai Flush agent on Publish instance WILL NOT work for me, since in my production, I have 4 publishers and I do not want Akamai requests to flow from all the 4 publishers.

2. I want this order of flushing cache -> First Publisher then Dispatcher and then Akamai to avoid any race condition.

Let me know if there is any better way to handle this use case.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

You cannot control the order in which the replication happens; these run asynchronous and can be blocked/delayed by various reasons (e.g. a publish might be down for restart).

If you want to enforce that the Akamai invalidation agent is triggered after the other replication happened, you have to run all activation through a workflow, and use synchronous replication to replicate to the publishs; in the next you can invoke the Akamai invalidation agent. But imagine the case when a publish is down; then your complete replication is blocked!

I solve this problem typically by not invalidating Akamai at all, but use TTL-based expiration on Akamai. You will deliver outdated content, but delivering 10 minute old content is typically not a problem.

Jörg

6 replies

arunpatidar
Community Advisor
Community Advisor
May 30, 2018

Hi,

You can try to add two Process Steps in your workflow and select Replication agent programmatically for example

1. first process step to replicate your content followed by flushing dispatcher cache on all 4 publishers

2. second process step Purge Akamai cache

With the help of that you can manage sequence.

CQ5.3: How to activate to a specific replication agent

Thanks

Arun

Arun Patidar
Level 2
May 30, 2018

Workflow is one option.

But for us, we want to get this working using the Activate button.

Is there any way?

smacdonald2008
Level 10
May 30, 2018

Looks like this can be done without workflows using code -- CQ5.3: How to activate to a specific replication agent

Level 2
May 30, 2018

Okay, if I understand correctly steps would be:

1. create an event listener for activation event

2. add custom code to replicate required replication agents in the given order as per your code.

3. SO now, whenever any file is activate-> triggers event listener which will decide which replication agent to invoke.

Is this the flow?

smacdonald2008
Level 10
May 30, 2018

I have personally not tried that - but it looks like the correct approach - according to that doc. I would start with that.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
May 30, 2018

You cannot control the order in which the replication happens; these run asynchronous and can be blocked/delayed by various reasons (e.g. a publish might be down for restart).

If you want to enforce that the Akamai invalidation agent is triggered after the other replication happened, you have to run all activation through a workflow, and use synchronous replication to replicate to the publishs; in the next you can invoke the Akamai invalidation agent. But imagine the case when a publish is down; then your complete replication is blocked!

I solve this problem typically by not invalidating Akamai at all, but use TTL-based expiration on Akamai. You will deliver outdated content, but delivering 10 minute old content is typically not a problem.

Jörg