spring-cloud / spring-cloud/spring-cloud-commons
About ApplicationEvent and BootStrap
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 751
- Forks
- 744
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
When I use "Spring Event Listener" to listen to the custom event "LivkEvent", use Spring.factories for autowiring, and introduce "org.springframework.cloud:spring-cloud-starter-bootstrap", my "Spring Event Listener" will Executed twice, I observed that the parent Application was generated when the event was published
this my demo code
I'm not sure if it's a bug or just by design
If the design is like this, what is a good solution
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached event-demo.zip and reproduce the custom ApplicationEvent with Spring.factories and org.springframework.cloud:spring-cloud-starter-bootstrap. Inspect how the parent and application contexts are created and how the listener is registered. Done means determining whether the duplicate execution is intentional and documenting or correcting the behavior accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100
