Class AsyncConfig
java.lang.Object
springboot.bg.harisauto.common.config.async.AsyncConfig
AsyncConfig.java - Enables
@Async execution and defines the executor it uses.
Without EnableAsync every @Async method runs inline on the calling
thread. That matters most for the registration welcome email: it is a synchronous
@EventListener that declares a checked MessagingException, so an SMTP
failure would propagate into the registration transaction and roll the new user back.
- Author:
- Kristian Popov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBounded executor for@Asyncwork, so a slow mail server cannot exhaust threads.
-
Constructor Details
-
AsyncConfig
public AsyncConfig()
-
-
Method Details
-
taskExecutor
Bounded executor for@Asyncwork, so a slow mail server cannot exhaust threads.
-