Skip to content

Annotation-based event listener does not receive event published in @PostConstruct [SPR-15122] #19689

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

František Hartman opened SPR-15122 and commented

Annotation-based event listener does not receive event published in @PostConstruct, while old style interface based listener does.

See example project at https://github.com/frant-hartm/spring-application-events

One event is published in @PostConstruct method of another bean. Another event is published from main method after context is initialised. Interface based listener sees both events, annotation based sees only the second one:

Interface based sees event: MyEvent{value='from postConstruct'}
Annotation based sees event: MyEvent{value='from main'}
Interface based sees event: MyEvent{value='from main'}


Affects: 4.3.5

Reference URL: https://github.com/frant-hartm/spring-application-events

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions