-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query - Configuration for Publish instance #11
Comments
Hi @kairas - Is this a simple change in config? |
So... Event handler that comes with the bundle is com/day/cq/replication which only occurs on author. BUT - The bundle decouples the service from the event handler so that anyone can create their own event handlers for this exact purpose. On publish instances the event I would actually listen for is org/apache/sling/api/resource/Resource/CHANGED since it actually contains a path property (unlike adobe/granite/replication). Your event handler should make sure that the path is part of the pathsHandled configuration so you aren't making API requests for undesired paths like inside /var |
Built in event handler uses "paths" property as a constant instead of "path" which is the property used by the resource change event so new event handler will be needed instead of property change. Though the amount of code needed would be minimal in your project. Would recommend using org.apache.sling.settings.SlingSettingsService to check run mode to ensure that the event handler only functions on the publish instance and if you have multiple publish instances it only runs on 1 of them. |
@ajaygates @ajaygogate Let me know if I can help in any other way |
Thanks Kai for your comments.
If I understand correctly, I need to write a new EventHandler similar to
what is there already.
- The new event handler will listen to
"org/apache/sling/api/resource/Resource/CHANGED" event
- Also I need ensure that its triggered only in 'publish' instance
by checking the run mode.
However I have question on "paths" and "path" constant.
At present this is defined in : FlushAkamiItemsJob. file
public static final String PATHS = "paths"
So If I am not supposed to use 'paths' and required to use 'path' - does
that also mean I need to change the "FlushAkamiItemsJob" code as well?
Or If I can re- define that variable and call it like this :
public static final String PATH = "path"
String[] path =
PropertiesUtil.toStringArray(event.getProperty(FlushAkamaiItemsJob.PATH))
Please let me know
Thanks & Regards
Ajay
…On Thu, Dec 6, 2018 at 8:11 AM Kai Rasmussen ***@***.***> wrote:
@ajaygates <https://github.com/ajaygates> @ajaygogate
<https://github.com/ajaygogate> Let me know if I can help in any other way
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATvvQDlHwvS-xDdwvoVHInhUqH85mjoWks5u2SWugaJpZM4Y4Zjl>
.
--
Thanks & regards
Ajay Gogate
|
The path property will be on the event
'paths' is the property to set when running the job topic com/velir/aem/akamai/ccu/impl/FlushAkamaiItemsJob
|
Thank you so much Kairas for your inputs.
I have done the changes in my eventhandler code (AkamaiEventHandler)
ts detecting the 'CHANGE' and tries to trigger purge job - but it fails
with some method exception.
Also I see the job gets triggered for any asset irrespective of using
"/content" filter.
Attaching the file for your reference.
Sorry to bother you. If at all possible can you guide me to the fix for
this.
Error seen in error log is :
06.12.2018 16:04:11.906 *ERROR*
[sling-threadpool-2d7efe9e-3ba4-4d0c-a187-8dc2bb5d1546-(apache-sling-job-thread-pool)-51-Akamai
Job Queue(com/velir/aem/akamai/ccu/impl/FlushAkamaiItemsJob)]
org.apache.sling.event.impl.jobs.queues.JobQueueImpl.Akamai Job Queue
Unhandled error occured in job processor No signature of method:
com.velir.aem.akamai.ccu.impl.FlushAkamaiItemsJob.getPathsToPurge() is
applicable for argument types: (org.apache.sling.event.impl.jobs.JobImpl)
values: [JobImpl
[properties=org.apache.sling.api.wrappers.ValueMapDecorator@939f54a0 :
{slingevent:application=caaafbb2-70b7-45e6-ba85-451748029f8c,
jcr:created=java.util.GregorianCalendar[time=1544133851888,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT-06:00",offset=-21600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2018,MONTH=11,WEEK_OF_YEAR=49,WEEK_OF_MONTH=2,DAY_OF_MONTH=6,DAY_OF_YEAR=340,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=4,HOUR_OF_DAY=16,MINUTE=4,SECOND=11,MILLISECOND=888,ZONE_OFFSET=-21600000,DST_OFFSET=0],
slingevent:created=java.util.GregorianCalendar[time=1544133851874,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT-06:00",offset=-21600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2018,MONTH=11,WEEK_OF_YEAR=49,WEEK_OF_MONTH=2,DAY_OF_MONTH=6,DAY_OF_YEAR=340,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=4,HOUR_OF_DAY=16
Thanks in advance!!
…On Thu, Dec 6, 2018 at 12:56 PM Kai Rasmussen ***@***.***> wrote:
The path property will be on the event
org.apache.sling.commons.osgi.PropertiesUtil.toString(event.getProperty("path"))
'paths' is the property to set when running the job topic
com/velir/aem/akamai/ccu/impl/FlushAkamaiItemsJob
jobManager.addJob("com/velir/aem/akamai/ccu/impl/FlushAkamaiItemsJob ",
[paths:["/content/food"]])
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATvvQGfLmF6DhdTbWFsHUsm-XOtdOUAJks5u2Wh2gaJpZM4Y4Zjl>
.
--
Thanks & regards
Ajay Gogate
|
Let me try to reproduce the issue and get back to you. I might need a couple of days. Can you try doing a remote debug from source control and see if you can see what the issue is yourself in the meantime? Can you provide what version of AEM you are using and the code for your event handler? |
Sure, I will continue my work as well - in debugging and fixing
Re sending my code.
I have AEM 6.3 version
Thanks
Ajay
…On Thu, Dec 6, 2018 at 5:23 PM Kai Rasmussen ***@***.***> wrote:
Let me try to reproduce the issue and get back to you. I might need a
couple of days. Can you try doing a remote debug from source control and
see if you can see what the issue is yourself in the meantime?
Can you provide what version of AEM you are using and the code for your
event handler?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATvvQHv3iM5DE2bR_Vlq6Nm_FjK82X9jks5u2abagaJpZM4Y4Zjl>
.
--
Thanks & regards
Ajay Gogate
|
Hi Kairas,
I was able to get this working for a path activated under '/content/'.
However it does not work for a node activation under '/etc'.
I will email you the changed 'AkamaiEventHandler' code.
Please have a look if you get a chance.
Thank you
…On Thu, Dec 6, 2018 at 7:12 PM Ajay Gogate ***@***.***> wrote:
Sure, I will continue my work as well - in debugging and fixing
Re sending my code.
I have AEM 6.3 version
Thanks
Ajay
On Thu, Dec 6, 2018 at 5:23 PM Kai Rasmussen ***@***.***>
wrote:
> Let me try to reproduce the issue and get back to you. I might need a
> couple of days. Can you try doing a remote debug from source control and
> see if you can see what the issue is yourself in the meantime?
>
> Can you provide what version of AEM you are using and the code for your
> event handler?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#11 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ATvvQHv3iM5DE2bR_Vlq6Nm_FjK82X9jks5u2abagaJpZM4Y4Zjl>
> .
>
--
Thanks & regards
Ajay Gogate
--
Thanks & regards
Ajay Gogate
|
Hello Team,
I am trying to move the Akamai connector from AEM Author to AEM Publish.
I made the config changes like 'adobe/granite/replication' instead of 'com/day/cq/replication' on publish side. I am able to see the logs updated however its not able to get the 'activated paths'.
Here is the akamai.log from Publish env
JUANCITO aem-sprint-akamai-bundle started
28.11.2018 14:29:59.963 INFO [Thread-20] com.velir.aem.akamai.ccu.impl.AkamaiEventHandler
Start handling event to add Akamai job
28.11.2018 14:29:59.964 INFO [Thread-20] com.velir.aem.akamai.ccu.impl.AkamaiEventHandler
THIS IS PUBLISH
28.11.2018 14:29:59.964 INFO [Thread-20] com.velir.aem.akamai.ccu.impl.AkamaiEventHandler Paths to flush null
28.11.2018 14:29:59.967 INFO [Thread-20] com.velir.aem.akamai.ccu.impl.AkamaiEventHandler Event details com/adobe/granite/replication
28.11.2018 14:29:59.967 INFO [Thread-20] com.velir.aem.akamai.ccu.impl.AkamaiEventHandler null has no valid path(s) to purge. No Job added
Not sure what is missing here.
The text was updated successfully, but these errors were encountered: