----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44516/ -----------------------------------------------------------
(Updated July 26, 2016, 4:34 p.m.) Review request for oozie. Changes ------- Thank you Abhishek for review. Implementing your suggestions. Bugs: https://issues.apache.org/jira/browse/OOZIE-2473 https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/OOZIE-2473 Repository: oozie-git Description ------- We have implemented a connection pool for SMTP connections in this patch. Following are the highlights: 1. Currently, we use Transport.send() static method to send an email. This will create new connection every time. 2. To avoid this, we can use sendMessage() method of Transport class and save the transport object inside pool. 3. Our current javax.mail package is quite old as per (http://mvnrepository.com/artifact/javax.mail/mail/1.4). It was when Sun Microsystems owned Java. I was getting "javax.mail.NoSuchProviderException: Invalid protocol: null" as they changed provider names. new - javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle] old - javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] Therefore, we switched to 1.5.5 version (https://java.net/projects/javamail/pages/Home). 4. We have used Apache Commons Pool (https://commons.apache.org/proper/commons-pool/) library for implementing pool. 5. PoolService has been introduced so that in future, anyone can make use of this/any library and implement their own pool. Through PoolService they can access it from anywhere. 6. oozie-default introduces some name-value pairs with respect to SMTP connection pool. Diffs (updated) ----- core/pom.xml f19d83b core/src/main/java/org/apache/oozie/ErrorCode.java 2907ca2 core/src/main/java/org/apache/oozie/action/email/EmailActionExecutor.java 902c463 core/src/main/java/org/apache/oozie/pool/smtp/ConnectionBuilder.java PRE-CREATION core/src/main/java/org/apache/oozie/pool/smtp/ConnectionBuilderFactory.java PRE-CREATION core/src/main/java/org/apache/oozie/pool/smtp/SMTPConnection.java PRE-CREATION core/src/main/java/org/apache/oozie/pool/smtp/SMTPConnectionFactory.java PRE-CREATION core/src/main/java/org/apache/oozie/pool/smtp/TransportBuilder.java PRE-CREATION core/src/main/java/org/apache/oozie/pool/smtp/TransportBuilderFactory.java PRE-CREATION core/src/main/java/org/apache/oozie/service/PoolService.java PRE-CREATION core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java 7631fc9 core/src/main/resources/oozie-default.xml 4563c73 core/src/test/java/org/apache/oozie/sla/TestSLAEmailEventListener.java 7e1921e core/src/test/java/org/apache/oozie/sla/TestSMTPConnectionPool.java PRE-CREATION pom.xml 5b7a863 Diff: https://reviews.apache.org/r/44516/diff/ Testing ------- Patch uploaded File Attachments ---------------- OOZIE-2473-1.patch https://reviews.apache.org/media/uploaded/files/2016/03/08/01278068-1566-4250-8fea-a5d04409c10e__OOZIE-2473-1.patch Thanks, Satish Saley