Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.5 multiple Sling event handlers ; same topic

NitroHazeDev
Level 7
Level 7

In AEM , say we have two projects within Aem instance where there are two sling event handlers with the same replication action chosen as topic , 

how would one ensure that both run and don't overlap/override and can coexist for the two projects ? 

I could think of filtering by path for the two projects but is it wise ? 

any concerns we could encounter ? 

1 Accepted Solution
Asutosh_Jena_
Correct answer by
Community Advisor
Community Advisor

Hi @NitroHazeDev 

 

Yes, you can apply the filter with path specific to the project and that should take care of everything. Based on the events from specific path, the implementation will be picked and there will not be any impact.

 

https://aem.redquark.org/2018/10/day-14-eventing-in-aem.html

 

Thanks!

View solution in original post

3 Replies
Asutosh_Jena_
Correct answer by
Community Advisor
Community Advisor

Hi @NitroHazeDev 

 

Yes, you can apply the filter with path specific to the project and that should take care of everything. Based on the events from specific path, the implementation will be picked and there will not be any impact.

 

https://aem.redquark.org/2018/10/day-14-eventing-in-aem.html

 

Thanks!

View solution in original post

Ritesh_Mittal
Community Advisor
Community Advisor

Hi @NitroHazeDev ,

 

You would not want to fire unnecessary event invocations so you should filter for project specific paths. Use path filter, and that should be ideal and good approach and it will also make sure that there will be no overlap/override.

 

https://github.com/riteshmittal/aemscheduler-even-handling/blob/main/EventHandlerExample.java

NitroHazeDev
Level 7
Level 7

Thank you Ritesh and Ashutosh for confirming the path based filtering option

 

That was my understanding as well but happened to hear it wasn't per the best practice and that left me confused.

Thank you ..