diff --git a/spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/ApplicationModuleListener.java b/spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/ApplicationModuleListener.java index 7bc7ada93..ce1902539 100644 --- a/spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/ApplicationModuleListener.java +++ b/spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/ApplicationModuleListener.java @@ -21,6 +21,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.context.event.EventListener; import org.springframework.core.annotation.AliasFor; import org.springframework.scheduling.annotation.Async; import org.springframework.transaction.annotation.Propagation; @@ -54,4 +55,15 @@ */ @AliasFor(annotation = Transactional.class, attribute = "readOnly") boolean readOnlyTransaction() default false; + + /** + * An optional identifier for the listener, defaulting to the fully-qualified signature of the declaring method (e.g. + * "mypackage.MyClass.myMethod()"). + * + * @since 1.1 + * @see EventListener#id + * @see TransactionalApplicationListener#getListenerId() + */ + @AliasFor(annotation = EventListener.class, attribute = "id") + String id() default ""; }