http://
or
https://
will be handled by AEM's HTTP transport handler. The convention is to create a unique URL protocol/scheme and have your transport handler's canHandle method watch for Transport URIs that start with your URL scheme. For example, by navigating to a clean instance's
Agents on Author page, you'll find default AEM replication agents using
http://
,
static://
,
tnt://
,
s7delivery://
and
repo://
. In this example, the transport handler is activated on the
amakai://
scheme and uses the hard coded Akamai API REST endpoint. A popular convention is to set your transport handler's Transport URIs that start with something like "foo-", which allows the user to configure their replication agent with either "foo-http://" or "foo-https://" and have your transport handler simply remove the custom prefix before making the HTTP request.
/libs/cq/replication/templates/agent
and
/libs/cq/replication/components/agent
to
/apps/your-project/replication
and update the agent like any other AEM component.
cq/replication/components/agent
. The only update needed to the copied component was the dialog options and the agent.jsp file as it contains JavaScript to open the dialog for which you need to update the path. Any additions to the dialog can be retrieved through the TransportContext's
getConfig().getProperties()
ValueMap.
Thank you for sharing, a lot of work on this post.
Hi Nate, Excellent post indeed. Have you considered the case of multiple publish instances and the need to delay the flush until all dispatchers have been flushed ? Any thoughts on that? Thanks
Hello Imad. These are certainly valid questions that need to be considered for your unique project. On my current project, we have custom workflows that trigger replication agents on the author instance for our Dispatchers and for Akamai. Since this method of activation isn't a part of our normal release path, the agents are set to "Ignore default" on the Agent Settings "Triggers" tab, and they're initiated programatically. We're not currently delaying the Akamai purge in any way and we haven't experienced any issues as of yet. You also want to think about your strategy holistically; do you need to purge Akamai on demand or could you rely on your Akamai TTL (time to live) settings?
Looks like a clean and better implementation than even listener. When I activate a page there is often a list of DAM assets that need to go with the page. It looks to me like each asset is sent as a single request to Akamai. I thought it would be better if we queue up the requests and send as a batch to Akamai. Any thoughts?
One more thing here: The template/component targets AEM6.1. A Sightly upgrade of the template and the component would be a lot cleaner.
You could write your custom replication agent with Sightly if you choose. However, as of this writing replication in AEM has not been updated to the Touch UI; I only needed to overlay a single file in order to change a single line of JS, so I felt the work to convert to Sightly would be premature at this time.
Thanks Nate, So how ContentBuilder fits into your context. I assume you are not using it but putting it here as an addition to TransportHandler.
In this example the ContentBuilder is being used to access the activated resources and add any vanity URLs to the purge/invalidation list. It's not necessarily needed as the behavior could take place in the TransportHandler if your desired. However, the ContentBuilder provides access to the session.
Also what would be trigger for this agent - manual or automatic? Automatic is what most use cases need.
A custom replication agent can be triggered in the same manner as an other replication agent. Check/uncheck "Ignore default" in the agent settings and/or trigger the agent programmatically as usual.
Excellent post ...! Thanks
Hi Nate. Your replication agent has been very helpful for me so far. I am trying to fix a scenario where agent gets triggered with any sort of node deletions/activations/deactivations. e.g. When some node from etc is programmatically deleted from author, agent gets queued up with the deactivate request for same path, which should not happen. Any suggestions how that can be handled?
Without knowing the full details of your application, one possible solution is to set your Akamai Replication Agent trigger to "Ignore default" and utilize a Replication Event Listener to programmatically replicate with the Akamai agent on activation of only certain nodes.
Hi Nate, I tried using this custom agent. I'm getting below error : Error while building replication content java.lang.IllegalArgumentException: Could not find configuration for domain 'production' Any idea on what have I missed?
Did you got the solution for this issue? I am also getting the same issue not sure what I missed. Error : Error while building replication content java.lang.IllegalArgumentException: Could not find configuration for domain 'production'
Please read lines 103-110 of the ContentBuilder implementation. In this demonstration I'm using the Externalizer service to create the full URL for Akamai to purge based off the resource path. You can replace that section of code with your own method, probably some string manipulation to concatenate the domain with the path, or you can configure the Externalizer service at http://localhost:4502/system/console/configMgr/com.day.cq.commons.impl.ExternalizerImpl with the "production" domain.
Hi Nate, I got to know from Akamai that "REST CCU API will be deprecated soon - you need to update the library to use the new OPEN framework. " Will this agent work with OPEN as it is or some changes will require in OPEN framework?
Hi Nate, While using this agent, the test connection gives 200 OK in response. But when I activate some resource, it shows blocked in queue with following logs: HttpResponseProxy{HTTP/1.1 403 Forbidden [Date: Wed, 03 Aug 2016 08:55:04 GMT, Server: Apache, Vary: Authorization, Content-Length: 192, Allow: GET, HEAD, POST, Keep-Alive: timeout=15, max=100, Connection: Keep-Alive, Content-Type: application/api-problem+json]} Can you please help me with this?
Hey Nate, excellent work, thanks. I've seen you listed AEM 6.1 as a requirement. Do you see any reason this shouldn't work on 6.0, as we're tied to that in a current project of ours. I just tried installing it, but got a com.day.cq.replication.AgentNotFoundException: Replication triggered, but no agent found! when testing the connection. However, I am unsure if this is because of a msiconfiguration or incomaptibilities with 6.0 Thanks, David
Hi Nate. This is great work! Your replication agent has been extremely helpful in helping my team develop a replication agent to replicate content metadata to a semantic database. The only issue we have come across is that the ContentBuilder's log messages sometimes do not appear in the replication log. Have you encountered this behavior before?
Great work Nate. This document has been very helpful.
Great Work Nate, but I wanted if you have tested the new fast purge feature of Akamai V3. If you could write something up to change the implementation for Akamai V3 using fast purge it will be a great help.
Comment removed by author.
Hi, I want to add a checkbox at author to provide an option to invalidate or not invalidate at akamai. Is there any possible way to add a property at page level and read that property during replication.so that i am restrict the author to invalidate that page at akamai?
<a href="http://missreplicawatches.com">cialis 5 mg</a> buy cheap cialis generic http://missreplicawatches.com
<a href="http://bullsac.com">levitra birth control</a> levitra versus cialis http://bullsac.com
<a href="http://motechautomotive.com">cialis pill</a> canadian cialis online http://motechautomotive.com
<a href="http://mphasset.com">best way to use viagra</a> difference between viagra and cialis http://mphasset.com
<a href="http://istanbulexpressonline.com">viagra coupon free trial</a> which is better cialis or viagra http://istanbulexpressonline.com
<a href="http://istanbulexpressonline.com">cheap viagra sydney</a> generic viagra pills http://istanbulexpressonline.com
<a href="http://gigawatt6.com">cheap cialis soft tabs</a> generic cialis india pharmacy http://gigawatt6.com
<a href="http://waltzweekend.com">order viagra softtabs</a> buy real viagra online cheap http://waltzweekend.com
<a href="http://buycialisonl1ne.us">cheap cialis online</a> viagra cialis online http://buycialisonl1ne.us
<a href="http://istanbulexpressonline.com">cheap viagra paypal</a> generic viagra mail order http://istanbulexpressonline.com
<a href="http://buyviagraonl1ne.us">order viagra online india</a> generic viagra without prescription http://buyviagraonl1ne.us
<a href="http://buyviagraonl1ne.us">viagra pills sale</a> buy viagra cheaply http://buyviagraonl1ne.us
<a href="http://missreplicawatches.com">buy cialis online prescription</a> order 5mg cialis online http://missreplicawatches.com
<a href="http://buyviagraonl1ne.us">cheap viagra paypal</a> buy female viagra http://buyviagraonl1ne.us
<a href="http://canadian-pharmaonline.com">brand viagra cheap</a> mail order viagra canada http://canadian-pharmaonline.com
<a href="http://viciolatino.com">viagra canada</a> cheap viagra pills online http://viciolatino.com
<a href="http://h-m-j.com">viagra for men</a> cheap viagra canadian pharmacy http://h-m-j.com
<a href="http://vico4me.com">cheap viagra 100mg</a> order pfizer viagra http://vico4me.com
<a href="http://canadian-pharmacyionline.com">generic viagra for sale</a> order generic viagra online http://canadian-pharmacyionline.com
<a href="http://canadian-pharmabuy.com">best place to buy viagra</a> buy real viagra online cheap http://canadian-pharmabuy.com
<a href="http://canadian-pharmaonline.com">viagra prices</a> viagra from canada http://canadian-pharmaonline.com
<a href="http://buycialisonlineglka.com">cheapest generic cialis online</a> very cheap cialis http://buycialisonlineglka.com
<a href="http://timsbmw.com">levitra over the counter</a> viagra levitra cialis comparison http://timsbmw.com
<a href="http://canadian-pharmakoani.com">purchase viagra online</a> cheap viagra no prescription http://canadian-pharmakoani.com
<a href="http://canadian-pharmabuy.com">cheap viagra usa</a> buy viagra without a prescription http://canadian-pharmabuy.com
<a href="http://canadian-pharmaorder.com">generic cialis without a prescription</a> cheap cialis overnight http://canadian-pharmaorder.com
<a href="http://canadian-pharmasale.com">cialis generic canada pharmacy</a> order generic cialis http://canadian-pharmasale.com
<a href="http://canadian-pharmaonline.com">generic viagra for sale</a> cheap viagra in usa http://canadian-pharmaonline.com
<a href="http://canadian-pharmaorder.com">cheap generic cialis canadian pharmacy</a> generic cialis online pharmacy http://canadian-pharmaorder.com
<a href="http://canadian-pharmabuy.com">order viagra uk</a> generic viagra online pharmacy england http://canadian-pharmabuy.com
<a href="http://canadian-pharmabuy.com">generic viagra 100mg for sale</a> buy generic viagra online usa http://canadian-pharmabuy.com
<a href="http://canadian-pharmacyionline.com">cheap viagra pills for men</a> generic viagra soft tablets http://canadian-pharmacyionline.com
<a href="http://rabbitinahat.com">cialis order online india</a> best place to buy generic cialis online http://rabbitinahat.com
<a href="http://buyviagraonl1ne.us">order viagra online without a prescription</a> viagra 100mg price http://buyviagraonl1ne.us
<a href="http://canadian-pharmacyionline.com">generic viagra 100mg prices</a> order generic viagra http://canadian-pharmacyionline.com
<a href="http://canadian-pharmacyibuy.com">discount cialis pills</a> generic cialis canada price http://canadian-pharmacyibuy.com
<a href="http://missreplicawatches.com">cheap cialis online uk shopping</a> buy cialis brand online usa http://missreplicawatches.com
<a href="http://canadian-pharmapills.com">cheap generic viagra from canada</a> buy viagra new york city http://canadian-pharmapills.com
<a href="http://vico4me.com">buy cheap viagra usa</a> best online pharmacy for viagra http://vico4me.com
<a href="http://baymontelreno.com">buy cialis with prescription</a> buy brand cialis online http://baymontelreno.com
<a href="http://valladium.com">cialis pills sale</a> generic cialis http://valladium.com
<a href="http://gigawatt6.com">where to buy cialis online forum</a> cialis side effects http://gigawatt6.com
<a href="http://buycialisonlineglka.com">cialis cost</a> generic cialis pills http://buycialisonlineglka.com
<a href="http://gigawatt6.com">buy cialis new york</a> cheapest cialis usa http://gigawatt6.com
<a href="http://viciolatino.com">generic viagra pills</a> buy viagra online cheap http://viciolatino.com
<a href="http://rabbitinahat.com">buy 20 mg cialis online</a> buy cialis online without a prescription http://rabbitinahat.com
<a href="http://valladium.com">cheap cialis 5mg</a> cheap cialis canada http://valladium.com
Can any one help out on this for aem6.3 I want to make a custom replication agent for akamai, I don't see the content builder code getting called i have mentioned details below But the problem i see when i select serialization as mentioned in the https://github.com/nateyolles/aem-akamai-replication-agent/blob/master/core/src/main/java/com/nateyolles/aem/core/replication/AkamaiTransportHandler.java I don't see the content builder code getting called/hit when below is executed at line 245 what could be the reason. final String content = IOUtils.toString(tx.getContent().getInputStream()); Then how will contentbuilder code will be called.
I intalled the package. but i am getting following error in logs: Bundle [626] Unexpected failure enabling component holder com.nateyolles.aem.core.replication.AkamaiTransportHandler (java.lang.NoClassDefFoundError: com/day/cq/replication/TransportHandler) java.lang.NoClassDefFoundError: com/day/cq/replication/TransportHandler and not able to create replicatio agent.
<a href="http://writeessayhtfd.com">viagra on sale in usa</a> cheapest generic viagra prices online http://writeessayhtfd.com
<a href="http://lizlarssen.com">order viagra online forum</a> online viagra prescriptions http://lizlarssen.com
Showbox is a must-have app for Android. It also works for Mac. <a href=http://www.pgsgd.com/home.php?mod=space&uid=655587>http://www.pgsgd.com/home.php?mod=space&uid=655587</a>
Ankur Chauhan | January 06, 2016 at 03:58 AM | Reply
Hi Nate, Thanks for this post.