Check for Objects Replication Queue. AEM6.5
Hi All,
I am new to replication topic. I need few guidance here, where i worte one pseudo code. I have to deactive the list of pages through replicator api in a workflow in AEM6.5, but only if the objects in replication queue will be less than 500, means we're restricting to avoid load on replication agent incase if we're having more than 500 pages in replication queue then our workflow will not trigger or execute and show error message to author
reading the replication objects from
/var/eventing/jobs/assigned/212-212-212-hashcode/com.day.cq.replication.job.publish1india
/var/eventing/jobs/assigned/212-212-212-hashcode/com.day.cq.replication.job.publish2china
/var/eventing/jobs/assigned/212-212-212-hashcode/com.day.cq.replication.job.publish1japan
@Override
public void execute (WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws
WorkflowException {
String payload = workItem.getWorkflowData().getPayload().toString();
if (rootPage != null && replicationQueueChechk()) {
replicator.replicate(session, ReplicationActionType.DEACTIVATE, paths, replicationOptions);
//code goes here...
}
}
private boolean replicationQueueChechk () {
//TODO check the number of active objects in replication queue, return true only if replication queue is less than 500, otherwise return false
}
How to restrict this and avoid triggring the workflow, or let me know if there is any optimize way to achieve this
Thanks
cc: @kautuk_sahni @arunpatidar @lukasz-m @veenavikraman @jagadeesh_prakash