bbottema/simple-java-mail

Executor settings passed to the builder are ignored

andrus opened this issue · 5 comments

I am integrating Simple Java Mail to the Bootique framework. It works great otherwise, but I noticed a small inconsistency. If I assemble the mailer like this:

MailerRegularBuilderImpl builder = MailerBuilder
    .withSMTPServer(resolveSmtpServer(), resolveSmtpPort())
    .withThreadPoolSize(5)
    .withThreadPoolKeepAliveTime(10);

Custom threadPoolSize and threadPoolKeepAliveTime are ignored, as the internal ExecutorService is resolved in MailerGenericBuilderImpl constructor, prior to those properties being redefined.

I found a workaround, which is to configured ExecutorService on my own, and pass it over to .withExecutorService. So while this is not an immediate issue for Bootique, I still figured I'd mention it here.

Thank you for reporting this. Will look into it asap.

Fix released in 6.0.4.

Thanks for the quick turnaround. Looking forward to 6.0.4

Should be in Maven Central in a few minutes

Already is. Works like a charm. Thanks!