Reputation: 10502
I am using spring MVC. I want to make a email notification system. Its job will be notify user about any activity happend. like facebook, twitter does.
What are the best approach considering huge number of email notification. I was thinking to use @Async
. but will it be a good approach for such kind of email notification services.
Upvotes: 0
Views: 1536
Reputation: 1237
If you plan to send huge number of emails, good option is to use some external services for that. It will require to do some work integrating them into your application, but if you're using Spring it shouldn't be too hard.
For example, consider Amazon SES, it has Java SDK with support of asynchronious operations, free tier and a sandbox for testing.
Upvotes: 0
Reputation: 68715
You can use Spring Email library
The Spring Framework provides a helpful utility library for sending email that shields the user from the specifics of the underlying mailing system and is responsible for low level resource handling on behalf of the client.
Huge number of emails should not be a problem, because email is neither cached in memory nor is high cpu consuming activity. Even if you are sending few hundreds of emails concurrently it should not be a problem. But don't believe my words, simply try doing it and use a profiler to confirm the performance.
Upvotes: 1