Skip to content
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

Open
ajaygates opened this issue Nov 28, 2018 · 10 comments
Open

Query - Configuration for Publish instance #11

ajaygates opened this issue Nov 28, 2018 · 10 comments
Assignees

Comments

@ajaygates
Copy link

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.

@kairas kairas self-assigned this Nov 28, 2018
@ajaygogate
Copy link

Hi @kairas - Is this a simple change in config?

@kairas
Copy link
Member

kairas commented Dec 6, 2018

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

@kairas
Copy link
Member

kairas commented Dec 6, 2018

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.

@kairas
Copy link
Member

kairas commented Dec 6, 2018

@ajaygates @ajaygogate Let me know if I can help in any other way

@ajaygates
Copy link
Author

ajaygates commented Dec 6, 2018 via email

@kairas
Copy link
Member

kairas commented Dec 6, 2018

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/foo"]])

@ajaygates
Copy link
Author

ajaygates commented Dec 6, 2018 via email

@kairas
Copy link
Member

kairas commented Dec 6, 2018

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?

@ajaygates
Copy link
Author

ajaygates commented Dec 7, 2018 via email

@ajaygates
Copy link
Author

ajaygates commented Dec 11, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants