[
https://issues.apache.org/jira/browse/OOZIE-2473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15185272#comment-15185272
]
Satish Subhashrao Saley commented on OOZIE-2473:
------------------------------------------------
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.
> Connection pool for SMTP connection
> -----------------------------------
>
> Key: OOZIE-2473
> URL: https://issues.apache.org/jira/browse/OOZIE-2473
> Project: Oozie
> Issue Type: Bug
> Reporter: Satish Subhashrao Saley
> Assignee: Satish Subhashrao Saley
> Attachments: OOZIE-2473-1.patch
>
>
> Currently, to send an email we setup new connection every time which seems
> costly. It would be good to have a connection pool.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)