----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44516/ -----------------------------------------------------------
Review request for oozie. 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 ----- core/pom.xml b72ea7d 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 d2360fc 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 26f10a3 Diff: https://reviews.apache.org/r/44516/diff/ Testing ------- Patch uploaded Thanks, Satish Saley
