Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

ReplicationEvent not triggering on the event in AEMaaCS

Avatar

Level 3

i'm trying to trigger this listener on the event of replication but its not triggering.

 

i have a scenario where i need delete zip extraction content in publish environment  on event of unpublish/delete zipfile from author environment.

 

same solution its working fine in on-prem but in AEMaaCS is not working. 

 

@component(service = EventHandler.class, immediate = true, 
property = {
 AppConstants.SERVICE_DESCRIPTION + "=Replication Listener on publish",
 EventConstants.EVENT_TOPIC + "=" + "com/adobe/granite/replication"
 })
public class ReplicationListener implements EventHandler {
    private static final Logger LOG = LoggerFactory.getLogger(ReplicationListener.class);
    private JobManager jobManager;
 
    @Override
    public void handleEvent(final Event event) {
 
            final String METHOD_NAME = "handleEvent";
            final ReplicationAction replicationAction = ReplicationEvent.fromEvent(event).getReplicationAction();
            final ReplicationActionType actionType = replicationAction.getType();
            final String filePath = replicationAction.getPath().
 
}
}
 
is there anything i need modify for AEMaaCS??
 
can anyone guide on this??
9 Replies

Avatar

Community Advisor

@KarthickVe 

 

Deactivation should automatically trigger delete on publish. This is OOTB behaviour. Are you observing some discrepancy?


Aanchal Sikka

Avatar

Level 3

@aanchal-sikka , This  EventConstants.EVENT_TOPIC + "=" + "com/adobe/granite/replication" event is not trigger in AEMaaCS and not sure why.

 

same its working fine in on-prem. i'm just trying to migrate to AEMaaCS but its not working.

Avatar

Community Advisor

@KarthickVe 

 

I guess that's because Cloud emits following event

aanchalsikka_0-1716874444310.png

Cloud uses SCD, thus the events might also be different.

 

But, as I mentioned earlier, please cross-check, deactivation from author should automatically delete files in publish OOTB.


Aanchal Sikka

Avatar

Level 3

by deactivating in author the published asset is removed in publisher and i also there is associate file i would like to delete along with removed file.

 

scenorio: zip file published and extracted using workflow.

when unpublished zip file is removed.

we have a custom solution which will remove the extraction content also in the event of unpublish or remove. this is not working now.

Avatar

Community Advisor

Thanks for the clarification @KarthickVe .

 

I hope the event shared in previous thread works for you.


Aanchal Sikka

Avatar

Administrator

@aanchal-sikka 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 have found out solution yourself, please share it with the community.



Kautuk Sahni