Issue with Dispatcher Flush Agents
Hi Everyone,
We're trying to clear the Dispatcher Cache of the Vanity URLs using some custom logic, where it is not exactly working.
We've created a page and configured some Vanity URLs for that page. Now when we activate the page all the URLs(Page URL and Vanity URLs) are passing through the Dispatcher Flush Agent of Author, but the Flush Agent configured in Publish is not getting the the Vanity URLs but the page URL is passing through the agent.
Example:
Created a page "/content/vanity-test" and configured "/test-vanity-1" and "/test-vanity-2" to that page. Now when I activate the page, all the URLs:
- /content/vanity-test
- /test-vanity-1
- /test-vanity-2
are passing through the Author Dispatcher.

But the Vanity URLs are not getting into the Publish Dispatcher, only the page URL is passing through it.

Custom Code:
for (Map.Entry<String, Agent> e : agentManager.getAgents()
.entrySet()) {
if ((e.getValue().isCacheInvalidator()
&& (e.getValue().getConfiguration().getTransportURI().contains(IntegrationConstants.CACHE_INVALDATION_URL))||
e.getValue().getConfiguration().getTransportURI().contains(IntegrationConstants.AKAMAI_INVALDATION_URL))) {
Agent dispatcherFlush = e.getValue();
try {
ReplicationAction ra = new ReplicationAction(
ReplicationActionType.DELETE, path);
ReplicationContent rc = dispatcherFlush.buildContent(session, ra);
dispatcherFlush.replicate(ra, rc,
new ReplicationOptions());
LOGGER.debug("$Activator cache flush requested. Check queue");
} catch (ReplicationException ex) {
LOGGER.error(ex.getMessage());
}
}
}
Please suggest why it would happen, where in Author Agent the Vanity URLs are going through but not in Publish Agent.
Note :
- The Flush Agent configured in Author is only for testing, main Flush Agent is configured in Publish instance only.
- The above code is in separate bundle and is deployed only in author not in publish. Is that could be the reason for the above issue ?
If yes, how can I invoke my custom code in Publish instance as I'm relying on the Preprocessor Class when I replicate the page, where as this activation process cannot happen in Publish how can I invoke the custom code for clearing the cache of Vanity URLs. Please suggest. Thank you