Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring JavaMailSender: Making it asynchronous and persistent

Is there an easy/lightweight way to add persistence to Spring's JavaMailSender and have it operate asynchronously? Does Spring provide any "built-in" support for this? I'm currently looking at queues with JMS, but they seem like overkill for the task at hand (looking at ActiveMQ and RabbitMQ). Is there a lightweight JMS option?

like image 399
Zecrates Avatar asked Aug 06 '26 23:08

Zecrates


1 Answers

Your approach with jms is fine. Unfortunately persistence and asynchronous processing is not such a simple task and you will have to code a bit.

However have a look at Spring integration, it provides built-in support for JMS inbounds and e-mail outbounds - all you have to do is connect the pieces via XML DSL.

like image 155
Tomasz Nurkiewicz Avatar answered Aug 10 '26 13:08

Tomasz Nurkiewicz