Tuesday, July 30, 2013

Clean and Simple Email Sender Design

Recently review design for an email sender with following requirements:

  1. Build a service to send email
  2. Service must have failover recovery, in youcase if system goes down and comes back up it should still send out pending email reminders
  3. You are not expecting any acknowledgements for the messages sent.
The design proposal in place was to use a funky framework with persistence store etc etc. 

After going through the simple requirements stated above, used following clean and simple design and I am happy to say we made right decision:

  1. Use Java Mail API to send email reminders
  2. Create a table which stores reminders to be sent and update a flag after email reminder is sent
  3. In case system goes down, you can resend all reminders for which flag was not set.
It was so simple and easy to implement and we have all control in our hand and there was no RAMP up time to learn new frameworks.

So, if you are confused with n number of ideas available out there using x number of frameworks, you can use the simple design explained above.

No comments:

Post a Comment

Java 9 Collection Changes Overview

Introduction Java 9 finally brings the convenience of creating small unmodifiable Collection instances using just one line code. New APIs...