Expand my Community achievements bar.

SOLVED

Are there any performance issues when dealing with javax.jcr.observation.EventListener?

Avatar

Level 6

Hi there, we are using javax.jcr.observation.EventListener to check if every created page has a property, and if it does, do something, This is set with an absolute path to /content/my-site. (we are targeting the jcr:content nodes)

Has anyone used this before, and are there any performance impacts that we should be aware of?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

 

If you are targetting the "jcr:content" node of pages, you can refine the registration for the observation listener and express, that you are only interested in changes on nodes of nodetype "cq:pageContent".

That's a very good way to reduce the overhead, because your code is only invoked in this special case.

 

Using Sling's ResourceChangeListener is less effective in this special case, because it cannot be limited by the nodetype. And that's a very effective measure to reduce the number of invocations.

 

View solution in original post

3 Replies

Avatar

Level 6

Thanks, but do you know the performance for the Sling Resource Listener?

But back to my question, Are there any performance issues when dealing with javax.jcr.observation.EventListener?

How about @Jörg_Hoh? can you please shed some light?

Avatar

Correct answer by
Employee Advisor

Hi,

 

If you are targetting the "jcr:content" node of pages, you can refine the registration for the observation listener and express, that you are only interested in changes on nodes of nodetype "cq:pageContent".

That's a very good way to reduce the overhead, because your code is only invoked in this special case.

 

Using Sling's ResourceChangeListener is less effective in this special case, because it cannot be limited by the nodetype. And that's a very effective measure to reduce the number of invocations.