views:

187

answers:

1

I'm currently porting a Rails App currently using REE to JRuby so I can offer an easy-to-install JRuby alternative.

I've bundled the app into a WAR file using Bundler which I'm currently deploying to GlassFish. However, this app has a couple of daemon processes and it would be ideal if these could be part of the WAR file, and potentially monitored by Glassfish (if possible).

I've looked at QuartzScheduler, and while meets my needs for a couple of things, I have a daemon process that must execute every 20 seconds as it's polling the database for any delayed mail to send.

If anyone can provide any insight as to how best to set up daemon processes in a JRuby/Java/Glassfish environment any help will be greatly appreciated! :)

A: 

One way to daemonize a JRuby process is to use akuma framework (on *nix) or others.
I would rather use cronjobs (schedulling) rather than daemons as they are less error-proned, daemons can leak memory, can stop on errors etc. Check jruby-quartz and quartz_scheduler

clyfe