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

Spring Boot 3 - javax.annotation.PostConstruct -> jakarta.annotation.PostConstruct #131

Open
cer opened this issue Jan 11, 2023 · 5 comments

Comments

@cer
Copy link
Contributor

cer commented Jan 11, 2023

Some Eventuate classes use @PostConstruct, and so cannot support Spring Boot 2 and Spring 3.

Perhaps the solution replace the annotation with old-style InitializingBean

/cc @kwonglau

@kwonglau
Copy link

I believe using the @bean(initMethod='', destroyMethod='') will work well and we can completely remove annotation.

@cer
Copy link
Contributor Author

cer commented Jan 11, 2023

Good point. I'd forgotten about that feature. 🤣

@cer
Copy link
Contributor Author

cer commented May 8, 2023

@kwonglau

Hmm... user-written code needs to use @PostConstruct - see eventuate-tram/eventuate-tram-sagas@33974c7

I think the API would be better if user visible @bean classes implemented InitializingBean

This might, however, require AbstractCommandDispatcher + Spring/Micronaut/... specific CommandDispatcher classes

Thoughts?

@kwonglau
Copy link

@cer I like the idea that visible @bean class implements the InitializingBean interface so that we can minimize the diff between Spring Boot 2 vs Spring Boot 3 codebase. This will also make migration easier.

@cer
Copy link
Contributor Author

cer commented May 19, 2023

@cer I like the idea that visible @bean class implements the InitializingBean interface so that we can minimize the diff between Spring Boot 2 vs Spring Boot 3 codebase. This will also make migration easier.

This might be a non-issue. These beans are created by factories, which can call initialize. That's what eventuate-tram/eventuate-tram-sagas@2e8071d should have done

cer added a commit to eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders that referenced this issue May 19, 2023
cer added a commit to eventuate-tram/eventuate-tram-core that referenced this issue May 19, 2023
cer added a commit to eventuate-tram/eventuate-tram-sagas that referenced this issue May 20, 2023
cer added a commit to eventuate-tram/eventuate-tram-sagas-examples-customers-and-orders that referenced this issue May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants