abcdwd commented on issue #31637:
URL:
https://github.com/apache/shardingsphere/issues/31637#issuecomment-2155978143
@Bean(name = "dynamicDataSource")
@Primary
public DynamicDataSource dataSource(DataSource masterDataSource) {
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceType.MASTER.name(),
masterDataSource);
setDataSource(targetDataSources, DataSourceType.SLAVE.name(),
"slaveDataSource");
setDataSource(targetDataSources, DataSourceType.PROFIT.name(),
"profitDataSource");
setDataSource(targetDataSources, DataSourceType.RPA.name(),
"rpaDataSource");
setDataSource(targetDataSources, DataSourceType.SHARDING.name(),
"shardingDataSource");
return new DynamicDataSource(masterDataSource, targetDataSources);
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]