Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new Hooking Point. #32554

Closed
chickenchickenlove opened this issue Mar 30, 2024 · 6 comments
Closed

Support new Hooking Point. #32554

chickenchickenlove opened this issue Mar 30, 2024 · 6 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@chickenchickenlove
Copy link

chickenchickenlove commented Mar 30, 2024

Hi, Spring Team.
This is chickenchickenlove, huge fan of you all.

I suggest adding a new Hooking point.
How about adding a new Hooking Point between SmartLifeCycle#start() and @PostConstruct?
Sometimes, IMHO, it could be useful at times.

It would be great if it could be used in a similar convention to ApplicationEvent and @EventListener.

@EventListener(BeforeSmartLifeCycleStart.class)
public void doSomething(){
...
}

Thanks for reading this. 🙇‍♂️

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 30, 2024
@quaff

This comment was marked as duplicate.

@snicoll
Copy link
Member

snicoll commented Apr 1, 2024

Sometimes, IMHO, it could be useful at times.

Thanks for the suggestion but, without at least one concrete example, this issue is not actionable I am afraid. Before we consider adding an extra API to the core framework, we need to understand what's lacking with what we have and how we could improve it.

@artembilan
Copy link
Member

I think SmartInitializingSingleton.afterSingletonsInstantiated() is the way to go for this use-case.
This way all the beans have called their afterPropertiesSet() and no SmartLifeCycle.start() called yet.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 2, 2024
@snicoll
Copy link
Member

snicoll commented Apr 2, 2024

That was one callback I had in mind indeed, but we can't know for sure until @chickenchickenlove shares why they're asking for another hook point.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Apr 2, 2024
@artembilan
Copy link
Member

In my feeling, according to the related Spring for Apache Kafka PR, the solution lays indeed in the afterSingletonsInstantiated().
And this request was done because @chickenchickenlove had not been aware about SmartInitializingSingleton.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 2, 2024
@snicoll
Copy link
Member

snicoll commented Apr 2, 2024

OK I am trusting you have more context on that so let's close this.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

5 participants