Skip to content

Support more advanced batch processing use cases #214

Closed

Description

@bbottema

Simple Java Mail currently uses threads for handling multiple async send calls, but each thread uses its own Session Transport instance. Unless the actual email payload is huge, creating opening Transport connection to the SMTP server takes about half of the time needed for sending the email.

This issue represents three improvements:

  1. Support Transport connection reuse over multiple threads
  2. Implement an SMTP connection pool so we have multiple reusable Transport connections (including lazy / eager initialization)
  3. Take performance to the next level and support clustered SMTP servers, so you can really scale up using multiple SMPT server if your use case requires it.

Solves #198

Activity

  1. added this to the 6.0.0 milestone on Jun 27, 2019
  2. self-assigned this
    on Jun 27, 2019
  3. bbottema commented on Jun 27, 2019

    @bbottema
    OwnerAuthor

    To support all these features, I'm looking for a thread-safe Generic Object Pool. My requirements are:

    1. Small code base
    2. Flexible enough to support eager / lazy object initialization and auto-expiry policy
    3. Simple to understand, so I can debug issues myself
    4. Up to date, active maintainer / community
    5. Good documentation, well tested
    6. High performance is nice but of secondary concern since my current use case is an SMTP connection pool

    I started out with Stormpot as object pool to implement a new SMTP connection pool library, but it is not flexible enough for this use case (and frankly too opinionated). And really the code is... not how I would like to support it (complicated, custom DSL). That on top of code that is already complex due to performance optimizations.

    I now started a new generic object pool which was originally inspired by the old and inactive KBOP but turned out to be a complete rebirth. It shaping out nicely currently so I'll be re-implementing the SMTP connection pool shortly. I'll add project links later on.

    I've already implemented the SMPT Connection Pool API and Cluster support in separate (micro) libraries and integrated it in Simple Java Mail, I just need to reintegrate it with the new generic object pool.

  4. bbottema commented on Jun 29, 2019

    @bbottema
    OwnerAuthor

    I've finished the generic-object-pool, clustered-object-pool and smtp-connection-pool libraries and integrated SNAPSHOT versions of these in Simple Java Mail.

    I'm going to release these to Maven soon and then I can finish this Simple Java Mail feature!

  5. bbottema commented on Jul 1, 2019

    @bbottema
    OwnerAuthor

    Libraries released. Simple Java Mail is now using SMTP Connection Pool successfully. Now I need to make expose the pool's configuration through Simple Java Mail builder API and property files.

    After that, provide proper documentation for the website.

  6. added 3 commits that reference this issue on Jul 3, 2019
  7. bbottema commented on Oct 9, 2019

    @bbottema
    OwnerAuthor

    Implementation is finished!

  8. bbottema commented on Dec 18, 2019

    @bbottema
    OwnerAuthor

    Released in 6.0.0-rc1!

  9. bbottema commented on Jan 24, 2020

    @bbottema
    OwnerAuthor

    6.0.0 has released as well, finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions