Skip to content

Clarify usage of @ConfigurationProperties annotated type declared with @Bean #18322

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

Closed
snicoll opened this issue Sep 23, 2019 · 1 comment
Closed
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@snicoll
Copy link
Member

snicoll commented Sep 23, 2019

The new constructor binding is automatically applied when a constructor is present. If an application was relying on a custom constructor to inject other components, they'll be broken on upgrade as we'll try to call that constructor to bind properties.

Moving to @Bean will work but keeping @ConfigurationProperties on the type will not generate the expected metadata.

See spring-attic/spring-cloud-stream-binder-kafka#750 for a concrete example.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Sep 23, 2019
@philwebb philwebb added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Sep 25, 2019
@philwebb philwebb added this to the 2.2.x milestone Sep 25, 2019
@snicoll snicoll assigned snicoll and unassigned snicoll Oct 2, 2019
@snicoll
Copy link
Member Author

snicoll commented Oct 14, 2019

This is now irrelevant as @ConstructorBinding is mandatory and the annotation processor uses this as the signal to harvest constructor parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants