Search code examples
tomcatclojurewindows-servicesnoir

Best practice running a Clojure background process on windows


I've got a process that will constantly run in the background, update a database, then the results can be checked in a noir based web app.

I'm currently running on windows. The currently runs as a local java process, however I'm wondering what the best practice is currently with Clojure running a background process.

I've got two possible thoughts

1 - Run the application as a local service. However I'm not sure what the best route for achieving this is on windows in the Java/Clojure world.

2 - Run and control the background process in something like Tomcat and make it is part of some sort of background process, separate from the users session. If this is viable, can anyone provide any guidance on what i should investigate to achieve this?


Solution

  • Unless your process/service needs some special libraries, processing or security handling provided by tomcat, most of the time it is not worth the overhead.

    Just use a java service wrapper for windows (here is how to use one: http://edn.embarcadero.com/article/32068) and you should be all set.

    Note that the configuration for the service hanlder is also supporting unix so that you are portable too.!