You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by Abhishek Bafna <ba...@gmail.com> on 2016/07/26 14:44:36 UTC
Re: Review Request 44516: Connection pool for SMTP connection
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44516/#review143524
-----------------------------------------------------------
core/src/main/java/org/apache/oozie/pool/smtp/ConnectionBuilder.java (line 24)
<https://reviews.apache.org/r/44516/#comment209337>
Can we fix class doc comment. Add one more star like /**.
This is required for all most all newly added classes into pool.smtp package.
core/src/main/java/org/apache/oozie/service/PoolService.java (line 51)
<https://reviews.apache.org/r/44516/#comment209342>
We should specific error message and error code to identify such scenarios.
core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java (line 179)
<https://reviews.apache.org/r/44516/#comment209339>
Can we enable validation for make, borrow and return calls. Someting like:
config.setTestOnCreate(true);
config.setTestOnBorrow(true);
config.setTestOnReturn(true);
core/src/main/java/org/apache/oozie/sla/listener/SLAEmailEventListener.java (line 192)
<https://reviews.apache.org/r/44516/#comment209340>
we should close the pool by calling the pool.close(), then we should remove it from the Map.
- Abhishek Bafna
On March 8, 2016, 5:07 p.m., Satish Saley wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44516/
> -----------------------------------------------------------
>
> (Updated March 8, 2016, 5:07 p.m.)
>
>
> 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
>
>
> 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
>
>