spring-boot-data-source-decorator icon indicating copy to clipboard operation
spring-boot-data-source-decorator copied to clipboard

DataSourceNameResolver does not work as expected

Open janput opened this issue 3 years ago • 0 comments

When using multiple datasource they all get the same name "dataSource". You cannot get the bean name from applicationContext.getBeansOfType(DataSource.class) because they haven't finished initializing. So the returned map will never contain the bean you are decorating. You should pass the bean name via a parameter in the resolveDataSourceName method.

janput avatar Oct 12 '22 11:10 janput