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

Update documentation where we recommend a @Qualifier on one bean and @Primary on another to suggest a single bean with defaultCandidate=false #42831

Closed
wilkinsona opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@wilkinsona
Copy link
Member

Framework 6.2 has introduced support for @Bean(defaultCandidate=false) which allows a bean to be declared such that it can only be injected where further constraints, such as a qualifier, are specified.

There are places in the documentation where we currently recommend declaring one bean with @Primary and a second bean with a qualifier, for example when configuring a Batch data source using @BatchDataSource or a Batch transaction manager using @BatchTransactionManager. We should review such documentation and consider recommending a single bean with both the qualifier and @Bean(defaultCandidate=false). A benefit of this over the current recommendation is that it allows any auto-configured bean of the same type to remain in place.

Note that the defaultCandidate=false approach won't work until we've upgraded to Framework 6.2.0 due to spring-projects/spring-framework#33762. As such, we should wait until after 3.4.0-RC1 and moving onto Framework snapshots before updating our docs.

@wilkinsona wilkinsona added type: documentation A documentation update status: on-hold We can't start working on this issue yet labels Oct 22, 2024
@wilkinsona wilkinsona added this to the 3.4.x milestone Oct 22, 2024
@wilkinsona wilkinsona self-assigned this Oct 22, 2024
@wilkinsona
Copy link
Member Author

There's going to be a 6.2.0-RC3 of Framework and we've already moved to snapshots so we can now do this one whenever we're ready.

@wilkinsona wilkinsona removed the status: on-hold We can't start working on this issue yet label Oct 22, 2024
@wilkinsona wilkinsona modified the milestones: 3.4.x, 3.4.0-RC1 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

1 participant