In our current implementation of programatic package creation and replication to boost performance we have two flows:
1. Programmatically create a package of name admin_package.zip which uses com.day.cq.wcm.api.PageManager.create(path, packagename) when ever activation of home page is detected.
2. Replicate package created in step1 using com.day.cq.replication.Replicator.replicate(session, ReplicationActionType.ACTIVATE, package.getNode().getPath());
The issue with this implementation is that whenever more than one author is activating the content (concurrent activation issue even though different pages) code is creating package of same name which is "admin_package.zip" for both the authors as both of them issued activation requests at the same time. This is throwing javax.jcr.ItemExistsException for second concurrent request and replication fails for that request.
So what we are assuming that we will add time stamp to the package name and then delete programatically the package after replication.
I am not getting the code how to do efficient deletion of package after replication in code. Has anyone done this type of implementation.
Or anyone has similar problem but followed a different approach.
Please let me know ideas and implementation details.
Solved! Go to Solution.
Views
Replies
Total Likes
you can use PageMgr api : pagemanager.delete(resource,boolean) , where resource will be your custom package.
Views
Replies
Total Likes
you can use PageMgr api : pagemanager.delete(resource,boolean) , where resource will be your custom package.
Views
Replies
Total Likes
We are creating a purge service to remove old packages using JMX service.
Views
Replies
Total Likes