tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QM <>
Subject Re: [OT] Proper way to open threads in a servlet
Date Fri, 01 Apr 2005 12:17:37 GMT
On Fri, Apr 01, 2005 at 11:45:40AM +0100, Mark Benussi wrote:
: I would place your e-mail in a MailManager that queues the messages and
: sends them out on a TimerTask (Every 10 seconds???).

Why not just use JMS?  The servlet puts messages in a queue and returns
to the user. In turn, a queue listener turns those messages into
e-mails.  [solves the problem of delaying the user response while
e-mails are sent]

If you don't have a separate server/service to run the queue listener,
do that inside a single Tomcat thread that is created/destroyed by a
ServletContextListener. [solves the thread hanging problem, as well as
the too-many-threads problem.]



software   --
tech news  --
code scan  --

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message