I'm creating a simple HTTP proxy that will sit between mobile apps and a backend SOAP server. The proxy server will be wrapped in a filter that sends e-mail and sms notifications when discovering certain types of messages. I've decided to use Scala, Finagle and Heroku. My client however insists that the system must not be tied down to Heroku, if ever they decide to host on their own Ubuntu servers. So, they are skeptical of using Heroku plugins that will make it difficult to setup the same service on Ubuntu later.
If anyone can share some ideas on approaching this problem, I will really appreciate it. In particular:
Sending mail from Java doesn't need system properties:
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
Session session = Session.getInstance(props);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("from@mycomp.com"));
message.setRecipients(Message.RecipientType.TO, new InternetAddress("to@mycomp.com"));
message.setSubject("Some Subject");
message.setText("Some Message");
Transport transport = session.getTransport("smtp");
transport.connect(host, port, username, password);
Transport.send(message);
Load the props and host, port, username, password out of a properties file if you like. Or out of a database.
So, sending mail is entirely independent of Ubuntu and Heroku.
Sending SMS I've done like this: http://nexmo.com/documentation/libs/index.html#java