Listeners and handlers are not giving changed or added property names issue in 6.4
Hi All,
As I can check there are multiple issues with different types of listeners we are facing in AEM 6.4, SP-1 & SP-2.
First Listener:
The below listener is getting called in AEM 6.4, SP-1 & SP-2. But, its not giving the changed and added property. It only gives the resource path which got chnaged and operation performed (changed and added).
import java.util.List;
import org.apache.sling.api.resource.observation.ResourceChange;
import org.apache.sling.api.resource.observation.ResourceChangeListener;
import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component(
service = ResourceChangeListener.class,
property = {
ResourceChangeListener.PATHS+"="+"/content",
ResourceChangeListener.CHANGES+"="+"ADDED",
ResourceChangeListener.CHANGES+"="+"REMOVED",
ResourceChangeListener.CHANGES+"="+"CHANGED"
}
)
public class SampleResourceChangeListener implements ResourceChangeListener{
public static final Logger LOGGER = LoggerFactory.getLogger(SampleResourceChangeListener.class);
@Override
public void onChange(List<ResourceChange> list) {
list.forEach((change) -> {
LOGGER.info(change.getPath());
LOGGER.info(change.getType().toString());
});
}
}
OUTPUT:

Second Listener:
The below listener is getting called in AEM 6.4, SP-1 & SP-2. But, its not giving the changed and added property. It only gives the resource path which got chnaged and operation performed (changed and added).
package ikpackage.core.listeners;
import org.apache.sling.api.SlingConstants;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.api.resource.observation.ResourceChangeListener;
import org.osgi.framework.Constants;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component(service = EventHandler.class, immediate = true, property = {
Constants.SERVICE_DESCRIPTION + "=Demo to listen event.job.topic on page Activation ",
EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/ADDED",
EventConstants.EVENT_TOPIC + "=org/apache/sling/api/resource/Resource/CHANGED",
EventConstants.EVENT_FILTER + "(&" + "(path=/content/we-retail/us/en/*/jcr:content) (|("
+ SlingConstants.PROPERTY_CHANGED_ATTRIBUTES + "=*jcr:title) " + "(" + ResourceChangeListener.CHANGES
+ "=*jcr:title)))" })
public class TestEventListener implements EventHandler {
private static final Logger LOG = LoggerFactory.getLogger(TestEventListener.class);
@Reference
private ResourceResolverFactory resourceResolverFactory;
@Override
public void handleEvent(Event event) {
LOG.info("Hi event is called ......");
}
}
OUTPUT: No added or changed property given as was earlier

Conclusion: I both the workflow we are not getting addedPropertyNames, changedPropertyNames and removedPropertyName.
Please let me know in case anyone able to find addedPropertyNames, changedPropertyNames and removedPropertyName in listener.
If I got something will post the same here for sure.
Thanks
