Daniel Perry wrote:
My favoured option is to write a struts plug-in, which uses a simple
database table to queue messages (reliable) or a vector (less reliable but
simpler), and implements an inject method, and this causes a thread to be
started if no thread exists that deals with delivery.  This thread
periodically find any messages, tries to send them, and if successful
deletes them.  At the end of it's attempts, if the queue is empty, it
finishes, otherwise it sleeps, and starts again.

My suggestion is to implement a JavaMail Transport. Have this transport use the existing SMTP transport, and if the delivery fails, spool messages to the local file system. A thread will also need to run to check that spool and retry indefinitely.


This approach is very easy to plugin to a number of environments, I would use disk over a DB since it is the easiest way to remove any remote system dependencies, and can still survive JVM crashes and restarts. Reading and writing MimeMessage to disk is very easy, too.

I would be very interested in this since I've been meaning to write something like for a while, but have about 20 of these projects and 0 time. :(

--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to