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

Fix "Configure Two DataSources" example #28712

Closed

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Nov 16, 2021

With the present example, the secondDataSource bean factory method will use firstDataSourceProperties due to it being annotated with @Primary.

This commit adds the @Qualifier needed to ensure secondDataSource bean factory method uses secondDataSourceProperties.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 16, 2021
With the present example, the `secondDataSource` bean factory method will use `firstDataSourceProperties` due to it being annotated with `@Primary`.

This commit adds the `@Qualifier` needed to ensure `secondDataSource` bean factory method uses `secondDataSourceProperties`.
@snicoll snicoll added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 17, 2021
@snicoll snicoll self-assigned this Nov 17, 2021
@snicoll snicoll added this to the 2.5.7 milestone Nov 17, 2021
snicoll pushed a commit that referenced this pull request Nov 17, 2021
With the present example, the `secondDataSource` bean factory method
will use `firstDataSourceProperties` due to it being annotated with
`@Primary`.

This commit adds the `@Qualifier` needed to ensure `secondDataSource`
bean factory method uses `secondDataSourceProperties`.

See gh-28712
@snicoll snicoll closed this in 663d5d4 Nov 17, 2021
@snicoll
Copy link
Member

snicoll commented Nov 17, 2021

Good catch, thanks Vedran!

@vpavic vpavic deleted the fix-two-datasource-example branch November 17, 2021 08:41
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

Successfully merging this pull request may close these issues.

None yet

3 participants