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
BedrockMission!

Learn More

View all

Sign in to view all badges

EventConstants.EVENT_FILTER is not triggered under /conf

Avatar

Avatar
Validate 10
Level 2
anelem1760873
Level 2

Likes

9 likes

Total Posts

59 posts

Correct Reply

3 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 10
Level 2
anelem1760873
Level 2

Likes

9 likes

Total Posts

59 posts

Correct Reply

3 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
anelem1760873
Level 2

04-05-2021

Hi There,

Does anyone know why this is not triggered, i want to get the removed event under this node /conf.

@component(
    service = EventHandler.class,
    immediate = true,
    property = {
        EventConstants.EVENT_TOPIC + "=" + TestEventHandler.EVENT_TOPIC,
        EventConstants.EVENT_FILTER + "=(path=/conf/*)"
    }
)
@Slf4j
public class TestEventHandler implements EventHandler {

    public static final String EVENT_TOPIC = "org/apache/sling/api/resource/Resource/REMOVED";

........

 -  

View Entire Topic

Avatar

Avatar
Boost 5
Level 6
Ritesh_M
Level 6

Likes

133 likes

Total Posts

108 posts

Correct Reply

37 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 6
Ritesh_M
Level 6

Likes

133 likes

Total Posts

108 posts

Correct Reply

37 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
Ritesh_M
Level 6

04-05-2021

 

Hi @anelem1760873 ,

 

Just check if the system user is having right permission which you must be using to get resolver. Like below-

 

Map<String, Object> params = new HashMap<>();
params.put(ResourceResolverFactory.SUBSERVICE, "myEventService");
resolver = resolverFactory.getServiceResourceResolver(params);