Package org.springframework.modulith
Annotation Interface ApplicationModuleListener
@Async
@Transactional(propagation=REQUIRES_NEW)
@TransactionalEventListener
@Documented
@Target({METHOD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Deprecated(since="1.1",
forRemoval=true)
public @interface ApplicationModuleListener
Deprecated, for removal: This API element is subject to removal in a future version.
An
ApplicationModuleListener
is an Async
Spring TransactionalEventListener
that runs in a
transaction itself. Thus, the annotation serves as syntactic sugar for the generally recommend setup to integrate
application modules via events. The setup makes sure that an original business transaction completes successfully and
the integration asynchronously runs in a transaction itself to decouple the integration as much as possible from the
original unit of work.
It is advisable that you use these integration listeners in combination with the Spring Modulith Event Publication Registry to make sure that the event publication does not get lost in case of an application or listener failure.
- Author:
- Oliver Drotbohm
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Deprecated, for removal: This API element is subject to removal in a future version.Whether the transaction to be run for the event listener is supposed to be read-only (default false).
-
Element Details
-
readOnlyTransaction
@AliasFor(annotation=org.springframework.transaction.annotation.Transactional.class, attribute="readOnly") boolean readOnlyTransactionDeprecated, for removal: This API element is subject to removal in a future version.Whether the transaction to be run for the event listener is supposed to be read-only (default false).- Default:
- false
-
org.springframework.modulith.events.ApplicationModuleListener
inspring-modulith-events-api
.