What is alternative for ReplicationAction in AEMaaCS | Community
Skip to main content
Level 4
May 24, 2024

What is alternative for ReplicationAction in AEMaaCS

  • May 24, 2024
  • 3 replies
  • 2300 views

I have a scenario where i trigger job in AEM Publish instance using ReplicationAction in on-prem, so now in AEMaaCS how to get replication object??

 

final ReplicationAction replicationAction = ReplicationEvent.fromEvent(event).getReplicationAction();
final ReplicationActionType actionType = replicationAction.getType();
final String FilePath = replicationAction.getPath();



i'm using the filePath to trigger job for removing the file/asset here.

 

could anyone guide me here that how to get path or file name while unpublishing/remove or publishing??

 

3 replies

Rohan_Garg
Community Advisor
Community Advisor
May 24, 2024

Hi @karthickve ,

You can publish/unpublish content using the Replication API in AEMaaCS -  API Documentation

Reference Link - https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/replication

So the same way should actually work as under the hood, AEMaaCS maps the replication actions (such as activate, deactivate) to corresponding Sling Content Distribution mechanisms.

 

Did you encounter any error when running the same program on AEMaaCS?

Level 4
May 24, 2024

Hello@rohan_garg ,

you mean below code is valid is AEMaaCS as well??

final ReplicationAction replicationAction = ReplicationEvent.fromEvent(event).getReplicationAction();
final ReplicationActionType actionType = replicationAction.getType();
final String FilePath = replicationAction.getPath();

i thought its deprecated now or later as we have sling content distribution in place for AEMaaCS.

 

is it okay to use same code in cloud as well??

 

 

 

 

 

Rohan_Garg
Community Advisor
Community Advisor
May 24, 2024

Yes, by maintaining the Replication API as a facade, AEMaaCS allows a smooth transition in moving from traditional AEM deployments to the cloud service, ensuring that custom replication logic and integrations continue to function correctly.

Harwinder-singh
Community Advisor
Community Advisor
May 24, 2024

@karthickve  You can use ReplicationAction.fromEvent(event).getPath() to get the resource path.

Level 4
May 24, 2024

Hello @harwinder-singhis it okay to use ReplicationAction.fromEvent(event).getPath() api code in cloud as well??

 

since AEMaaCs uses sling content distribution api so i'm having doubt here.

Level 4
May 28, 2024

@karthickve Can you please use com/day/cq/replication as event topic?


@harwinder-singh This  com/day/cq/replication event will be used in author not works in publish. all the event handler not working in cloud. only event listener is working in cloud.

kautuk_sahni
Community Manager
Community Manager
June 10, 2024

@karthickve Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni