You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Hiran Chaudhuri (Jira)" <ji...@apache.org> on 2025/09/16 06:40:00 UTC

[jira] [Commented] (EMAIL-211) Add connection pooling

    [ https://issues.apache.org/jira/browse/EMAIL-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18020553#comment-18020553 ] 

Hiran Chaudhuri commented on EMAIL-211:
---------------------------------------

I updated the initial description as I was forced to move to another library. If other users find themselves in similar situations this would be a complete no-go for this library.

Thus I believe the priority should be raised even higher.

> Add connection pooling
> ----------------------
>
>                 Key: EMAIL-211
>                 URL: https://issues.apache.org/jira/browse/EMAIL-211
>             Project: Commons Email
>          Issue Type: New Feature
>            Reporter: Hiran Chaudhuri
>            Priority: Major
>
> Congratulations for an easy to use straightforward client library.
> However the application I created spends most of it's time connecting to the mailserver. How come?
>  
> Apparently the examples on [https://commons.apache.org/proper/commons-email/userguide.html] follow this pattern:
>  
> {code:java}
> Email email = new SimpleEmail();
> ...
> email.addTo("foo@bar.com"); email.send();
> {code}
> As an effect, in the background it creates a JavaMail Session and Transport, uses it to send the email and then forgets about it again. In my environment building a connection requires to get an authentication token, then using that for secure SMTP. Establishing such a connection takes a few seconds, which limits the throughput of sending emails.
> Even worse: As my organization's SMTP server sees too many connections coming in it assumes a DOS attack and stops responding. That means my application is locked out despite it tries to send legit emails. I have to find some other way.
>  
> Please add a feature (or document how to do if already possible) to reuse connections for sending several mails. Also the solution should be thread safe so a multithreaded application can send emails in parallel.
>  
> I guess this should be easily doable by combining commons-pool and commons-email. However my attempts failed miserably, making me want to switch to other mail client libraries altogether.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)