What I'm doing in a project is even more convoluted, what can I say? :),
upon receiving the request, I start a quartz task to be run inmediately
that sends a JMS message to the remote server that does the real task.
This way you can return inmeditaly to take care of the response and if
the quartz task fails to reach the JMS server, for whatever reason, it
can auto-schedule itself to try again in 5 minutes, etc. But that's just
for a complicated specific case.
We used to do these tasks with cron jobs, but we moved away from them
because they were OS specific, we needed to create a .bat or .chs
version and check it against the shell in the *nix server, and had to be
installed separately. As we usually have to move from server to server,
we opted in the end to have everything installed in one package with no
OS dependencies. But it depends on your needs and environment. IMHO,
there is no one-size-fits-all.
Pauly Shore escribió:
> Thank you for your very helpful suggestions ... the other suggestion I
> received was to use a JMS message, and send the processing off to a
> distributed server. This way the response can return to the browser straight
> away, and the heavy processing can be done asynchronously.
> I think for the time being I'll go with the separate Java task that runs
> separately - outside of Resin. It seems like the simplest solution and I
> won't need to worry about thread leaks, memory leaks etc.
> - Pauly
resin-interest mailing list