Hi
We are using replicator api to clear dispatcher cache programmatically on AEM as a Cloud service,
Below are the lines used.
ReplicationOptions options = new ReplicationOptions();
options.setSynchronous(true);
options.setFilter(agent -> agent.getId().equals("flush"));
this.replicator.replicate(session, ReplicationActionType.DEACTIVATE, paths, options);
It is working as expected for publishers. But we are getting below exception for golden publishers.
Exception while clearing cache com.day.cq.replication.AgentNotFoundException: Replication triggered, but no agent found!
May i know how we can restrict the code to execute only for publishers not golden publishers.