Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Custom Event Handler is not getting triggered on click of Publish/Unpublish to Brand Portal in AEM Cloud environments

Avatar

Level 2

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.

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 2

@Harwinder-singh 

 

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.

View solution in original post

3 Replies

Avatar

Community Advisor

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

 

Avatar

Level 2

@Harwinder-singh 

 

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 {}

 

 

Avatar

Correct answer by
Level 2

@Harwinder-singh 

 

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.