异常信息如下:
The configuration of the pool is sealed once started. Use HikariConfigMXBean for runtime changes.
使用 spring boot 2.0 以上默认使用Hikari
连接池,一旦连接池启动,就无法再修改HikariDataSource,所以刷新配置时连带数据源一起刷新,于是报错。
解决方法: 在自定义的DataSource上加入注解@RefreshScope,或者使用spring.scloud.refresh.extra-refreshable配置指定classname列表。我采取的时直接加 @RefreshScope 注解的方式
因篇幅问题不能全部显示,请点此查看更多更全内容