baomidou / dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
Apache License 2.0
4.76k stars 1.2k forks source link

考虑去掉DynamicRoutingDataSource里的@Component注解 #586

Closed oracle-fusion-middleware-team closed 1 year ago

oracle-fusion-middleware-team commented 1 year ago

Please fill it out carefully, or it will be closed. 请认真填写,不然会直接关闭。

Enviroment

JDK Version(required): 17

SpringBoot Version(required): 3.1.1

dynamic-datasource-spring-boot-starter Version(required): 4.2.0

druid Version(optional): None (Using Hikari)

Describe what happened

DynamicDataSourceAutoConfiguration已经将DynamicRoutingDataSource作为Bean暴露出来了,原类上不需再写@Component注解。 DynamicDataSourceAutoConfiguration在暴露这个@Bean的时候写了@ConditionalOnMissingBean;实际暴露的是那个@Component,不是这个@Bean。

Expected Result: DynamicRoutingDataSource上没有@Component注解。

Actual Result: DynamicRoutingDataSource上有@Component注解。

If there is an exception,or aop invalid,please attach the exception trace:

Just paste your stack trace here!

Steps to reproduce

huayanYu commented 1 year ago

1