Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Implement SJM as daemon process, so CLI is much faster and can utilise the batch-module #488

Open
Al-mcne opened this issue Dec 20, 2023 · 2 comments

Comments

@Al-mcne
Copy link

Al-mcne commented Dec 20, 2023

23:59:46 [main] WARN BatchSupport - Starting SMTP connection pool cluster: JVM won't shutdown until the pool is manually closed with mailer.shutdownConnectionPool() (for each mailer in the cluster)

How I can use your Simple-jave-mail in the batch mode?
I supplied all the required parameters for CLI. An email was successfully sent, but the process was never completed.
I'm thinking about a fully automated process and "manual" Ctrl^C is not a option.
How I can automatically close the current SJM process?
image

@bbottema
Copy link
Owner

Hhm, I'm wondering if the batch module makes sense on the CLI at all, since you can't actually send emails in batches on the CLI. Each action is a separate process and connection pools don't last between sessions.

What I mean is Simple Java Mail doesn't have a daemon process running in the background... I never thought about that before, but it's a nice feature request to think about! Would speed up sending emails significantly (after initially spinning up a daemon).

You can simply remove the batch-module.jar from the libraries folder, for now. That will solve your immediate problem.

@bbottema bbottema changed the title JVM won't shutdown until the pool is manually closed [Feature] Implement SJM as daemon process, so CLI is much faster and can utilise the batch-module Dec 20, 2023
@Al-mcne
Copy link
Author

Al-mcne commented Dec 21, 2023

Thank you for the quick solution!
It works perfectly on the Windows platform (sjm.bat)
Later I will validate the same solution on Linux.

Thank you again!
Alex
image

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

No branches or pull requests

2 participants