Highlighted

AEM 6.4 - Programatic flush request

qglez

17-08-2018

Hi

I'm trying to perform a flush request from a custom workflow step.

In order to send the request I'm using the  sendFlushUrl method from the FlushService.
But when  when I do in the error log I get the following message:

com.adobe.cq.social.ugcbase.dispatcher.impl.FlushServiceImpl Worker.run: no agents available - ignoring flush: FlushJob[urlToFlush=/content/xxx/xxx/xxx, refetchUrls=/content/xxx/xxx/xxx]

I had configured the default dispatcher flush agent to point the webserver url.

Does anyone face this problem or know any other way to do it?

Thanks in advance

Replies

Highlighted

kautuk_sahni

Community Manager

21-08-2018

In order to make the flush service working properly, create flush agents for each dispathcer with following additional settings-

1. Set the Request method - "POST" because this service expects a POST method flush agent.

2. Send additional parameter for "resource only replication"

Also, there are other way to do this. Please have a look at AEM 6.0 and above: Programmatic Cache Invalidation in AEM 6

-Kautuk

Highlighted

qglez

27-08-2018

Hi, sorry for the delayed response

smacdonald2008

With the cURL call form a terminal it works as expected, not sure why the method described not work.

kautuksahni
I review the configuration and it seems to be correct. I've already check the link you posted, that's why I was trying to use the sendFlushUrl from the FlushService.

I finally archive a solution, after a review on the requirements, using the replicator service and a EventListener.

Thank you both for your collaboration.

Highlighted

sudhakars10

28-04-2019

Hi qglez

I am looking for the same solution, Could you please pass the source for Listener and Replicator service in this thread ?