Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Issue with ResourceChangeListener functionality

Avatar

Level 2

I need to save few property(customlastModified and loggedinUser based ) on dropdown selction (inprogress and approved) of basic tab of page. To implment this I used OOTB property i.e. resourceChnageListener and overridden on chnage menthod. One strange behavious I have notices is it is triggering lots of other pages even if that particular property is not chnaged. Due to which my log size is growing exponentially and making my local system filled as segment store size is getting bigger and bigger becuase of it.

On my local instance, the error log file grows up to 4GB if the instance runs overnight.

Sample code snippet

@component(immediate = true,
service = ResourceChangeListener.class,
property = {
ResourceChangeListener.PATHS + "=" + "<pagePath>",
ResourceChangeListener.CHANGES + "=" + "CHANGED",
ResourceChangeListener.PROPERTY_NAMES_HINT + "<propertyName>"
})

public class PropertyChangeListener implements ResourceChangeListener{


@Override
public void onChange(@NotNull List<ResourceChange> list) {
for (ResourceChange resourceChange : list){}}

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Correct answer by
Community Advisor

Avatar

Level 10

The ResourceChangeListener.PROPERTY_NAMES_HINT can be somewhat misleading, as it implies that the listener is exclusively focused on the specified property names. However, this is merely a suggestion; a change listener that registers with this property should be aware that the underlying implementation may not filter events based on it. As a result, the listener may receive all events defined by the other properties and this aspect must be taken into consideration in your implementation.

Avatar

Administrator

@rajmishra10 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!



Kautuk Sahni