Skip to main content
Level 2
Apr 10, 2025 9:13 AM UTC
Solved

Issue with ResourceChangeListener functionality

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

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

public class PropertyChangeListener implements ResourceChangeListener{


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

arunpatidar
arunpatidarAccepted solution
Community Advisor
Apr 10, 2025 11:58 AM UTC

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
Apr 10, 2025 11:58 AM UTC
giuseppebaglio
Level 10
Apr 11, 2025 7:56 AM UTC

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.

Translate
kautuk_sahni
Level 9
Jul 9, 2025 7:37 AM UTC

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

Translate
Kautuk Sahni