Events API no working for Alfresco Content sevrive Enterprise - 7.0.0

cancel
Showing results for 
Search instead for 
Did you mean: 
rkhot
Member II

Events API no working for Alfresco Content sevrive Enterprise - 7.0.0

Hi Alfresco Team,

I am currently working on Events API for Alfresco Content sevrive Enterprise - 7.0.0

I am trying to run the springboot example program as explained in the link below :
https://docs.alfresco.com/content-services/latest/develop/oop-sdk/#creating-event-handler-projects

This program should get triggered when I create any node (file, wiki etc).
But on my machine, the event is not getting triggered. Nothing gets updated in the logs.

Please advise.

Regards
Rahul

 

Here is the class

public class EventdemoApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(EventdemoApplication.class);

public static void main(String[] args) {
LOGGER.info("Inside main()");
SpringApplication.run(EventdemoApplication.class, args);
}

@bean
public IntegrationFlow logError() {
return IntegrationFlows.from(EventChannels.ERROR).handle(t -> {
LOGGER.info("Error: {}", t.getPayload().toString());
MessageHandlingException exception = (MessageHandlingException) t.getPayload();
exception.printStackTrace();
}).get();
}

@bean
public IntegrationFlow logCreateFileNode() {
return IntegrationFlows.from(EventChannels.MAIN) // Listen to events coming from the Alfresco events channel
.filter(IntegrationEventFilter.of(EventTypeFilter.NODE_CREATED)) // Filter events and select only node created events
.filter(IntegrationEventFilter.of(EventTypeFilter.NODE_DELETED))
.filter(IntegrationEventFilter.of(EventTypeFilter.NODE_UPDATED))
.filter(IntegrationEventFilter.of(EventTypeFilter.PERMISSION_UPDATED))
//.filter(IntegrationEventFilter.of(IsFileFilter.get())) // Filter node and make sure it is a file node
.handle(t -> LOGGER.info("File uploaded: {}", t.getPayload().toString())) // Handle event with a bit of logging
.get();
}
}