I'd like to stay complete reactive within my new spring application. Therefor I use web-flux/ reactor and ReactiveRepository with MongoDB.
Do you know how to integrate java-mail reactively into the tech-stack? Any alternatives?
The only useful non-blocking SMTP client I found and still use is https://vertx.io/docs/vertx-mail-client/java/
I even integrated it with spring-webflux and mongodb-driver-reactivestreams so that they share the same Netty EventLoopGroup.
Mono.create<MailResult> { sink ->
mailClient.sendMail(email) { asyncResult ->
if (asyncResult.succeeded()) {
sink.success(asyncResult.result()
} else {
sink.error(asyncResult.cause()
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With