After mentioning my patch for AWS SDK on google-appengine mailing list I got few inquiries so I decided to write a post with more details about how to use it…
1. Get patched AWS SDK from https://github.com/radomirml/aws-sdk-for-gaej
This adapted version makes possible use of AWS SDK on Google AppEngine allowing user to provide own HTTP Client Factory implementation. A custom HTTP Client Factory class is needed to provide an implementation of HTTPClient that sends requests using GAE’s URL Fetch service.
Disclaimer: Currently, I’m using the patched library with SES service only. It should work with other AWS SDK APIs as well but I didn’t try it. For SES only, you can download the jar file I built stripping out unneeded APIs.
Use the built jar file to replace the original aws-java-sdk jar file. AWS SDK depends on Apache HttpClient 4 so you’ll need to add its jars your project too.
2. Get (or make) GAE compatible ClientConnectionManager class
Get and use the ClientConnectionManager implementation created by ESXX or you may want to use it as a starting point and customize according to your needs.
3. Send email using SES
Assuming you were already using JavaMail API to send emails under GAE, you probably have a line like:
that dispatches your message. Replace this line with a block of code that will send the email via SES:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25