Expand my Community achievements bar.

SOLVED

Running a daemon like service

Avatar

Level 5

Hello trying to run a daemon like service on AEM. What is the best practice for this?

Use case is need to run a service that constantly watches a folder outside of AEM and pulls in content whenever it's uploaded to it.

Better to trigger this as an servlet or and OSGi service? Or can I implement this like a daemon somehow?

Thanks!!!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Service. You can also build a scheduler on it so it checks everyone often - this is the power of custom services - see this as an example of a scheduled service: 

http://scottsdigitalcommunity.blogspot.ca/2014/05/scheduling-adobe-experience-manager.html

View solution in original post

3 Replies

Avatar

Level 10

To implement this - you need to write a Java OSGi bundle. This is how AEM works - not using UNIX daemon services. 

You need to write the Java app logic - however - there are many online resources that will point you in the correct direction - ie: https://docs.oracle.com/javase/tutorial/essential/io/notification.html

Avatar

Level 5

Thank you Scott, what would be the best practice way of triggering this?

Service or Servlet?

Avatar

Correct answer by
Level 10

Service. You can also build a scheduler on it so it checks everyone often - this is the power of custom services - see this as an example of a scheduled service: 

http://scottsdigitalcommunity.blogspot.ca/2014/05/scheduling-adobe-experience-manager.html