Custom Event Handler is not getting triggered on click of Publish/Unpublish to Brand Portal in AEM Cloud environments - We have a custom event handler named DAMReplicationListener.java in our codebase and it is getting triggered on click of Publish/Unpublish to Brand Portal on AMS but it's not getting triggered on AEM Cloud environments. We have registered our custom event handler named DAMReplicationListener.java using the event.topics value as "com/day/cq/replication". Can you please let us know the reason why it is not working on AEM Cloud?, Also please let us which event.topic we need to use so that on click on Publish/Unpublish to Brand Portal our custom event handler will trigger.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
I found the solution for this issue.
we need to use event.topics with value as "org/apache/sling/distribution/agent/package/distributed".
Also, I have used "event.filter=(distribution.component.name=bpdistributionagent*)" so that only Brand Portal related publish/unpublish events are capture in the event handler.
@Saikrishna Can you please share the Java class code here for us to check if everything is in order.
Also, If it was working earlier ,see if your eventListener is blacklisted. That can also cause the eventlistener to stop working.
check if you see this message in the logs if you think it might be blacklisted
org.apache.felix.eventadmin EventAdmin: Blacklisting ServiceReference [[org.osgi.service.event.EventHandler]
I have checked logs and I don't see any log related to below so my event handler is not backlisted
org.apache.felix.eventadmin EventAdmin: Blacklisting ServiceReference [[org.osgi.service.event.EventHandler]
Also, My Custom event handler DAMReplicationListener.java is getting triggered when you click on Publish to AEM in cloud environments but not getting triggered when you click on Publish to Brand Portal in cloud environments.
Please fine the below code on how we have registered event handler. I cannot share whole to you as it belongs to client.
Value of EventConstants.EVENT_TOPIC is event.topics
Value of ReplicationAction.EVENT_TOPIC is com/day/cq/replication
@Component(service = EventHandler.class, immediate = true,
property = { EventConstants.EVENT_TOPIC + AnfConstants.EQUALS_SYMBOL + ReplicationAction.EVENT_TOPIC },
configurationPolicy = ConfigurationPolicy.REQUIRE)
public class DAMReplicationListener implements EventHandler {}
I found the solution for this issue.
we need to use event.topics with value as "org/apache/sling/distribution/agent/package/distributed".
Also, I have used "event.filter=(distribution.component.name=bpdistributionagent*)" so that only Brand Portal related publish/unpublish events are capture in the event handler.
Views
Likes
Replies