Wednesday, January 17, 2007

Fault tolerant email queues

I had written an application that could send emails . That was done using javamail API. However at that time my requirements were "just" to deliver an email. The usage was not high and our application was on same network as our SMTP server. sending few emails far and between did not turn out to be an issue! However, today , I want to write a component that can send higher volumes of email (something like 20,000 in one shot). My earlier program will surely run out of steam here.
The program should try to resend the failed messages again. If one message send fails then it should just move on to the next one. Some smartness may also be required ,like checking domain names. We should have some way to mark delivered messages and of course we need some kind of queue implementation.
My first reaction now a days is to look for some ready made component. But surprise, surprise!!! so far I have not been able to locate any open source project that fulfils my requirements. I am approaching this problems from three angles
  • See if some message queue or enterprise bus can be used. I do not want to do lot of configurations etc. because my only mode of transport is email and that too one way only! There are a number of open source message queue implementations , I am looking at Mule in particular.
  • See if some MTA like qmail fits my bill. If there are APIs for MTA then I may be through. After all people have been using /bin/sendmail to send emails since time immemorial
  • turn to search.cpan.org as usual (when i am really desperate)
Final option is to write the component by hand. I am ready for that also but the question to ask is If I can trust javamail for a scalable job. still a way to go .....
© Life of a third world developer
Maira Gall