You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/12/30 02:31:52 UTC
[GitHub] [shardingsphere] JiekerTime opened a new issue #8816: ShardingSphere JDBC整合Spring Boot的BUG
JiekerTime opened a new issue #8816:
URL: https://github.com/apache/shardingsphere/issues/8816
我在整合Spring Boot和ShardingSphere JDBC 5.0.0alpha使用读写分离算法ROUND_ROBIN的时候,在加载配置文件的时候会出现一些问题。
首先明确官网中对于ROUND_ROBIN的参数并没有要求:

其次进行问题描述:
我的配置文件:
`spring.shardingsphere.datasource.names=master,slave
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://localhost:3306/master?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
spring.shardingsphere.datasource.master.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=123456
spring.shardingsphere.datasource.slave.jdbc-url=jdbc:mysql://localhost:3306/slave?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
spring.shardingsphere.datasource.slave.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.slave.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave.username=root
spring.shardingsphere.datasource.slave.password=123456
spring.shardingsphere.props.sql-show=true
spring.shardingsphere.rules.replica-query.load-balancers.round-robin.type=ROUND_ROBIN
spring.shardingsphere.rules.replica-query.data-sources.masterandslave.primary-data-source-name=tb_user
spring.shardingsphere.rules.replica-query.data-sources.masterandslave.load-balancer-name=round-robin
`
这样运行会报错:

尝试加上.props:
`spring.shardingsphere.rules.replica-query.load-balancers.props=a:b`
仍会出现问题:

debug过程:


个人认为是因为
spring.shardingsphere.props与spring.shardingsphere.rules.replica-query.load-balancers.round-robin.props读写出现混乱导致的。
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on issue #8816: ShardingSphere JDBC整合Spring Boot的BUG
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #8816:
URL: https://github.com/apache/shardingsphere/issues/8816#issuecomment-752305606
**For English only**, other languages will not accept.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu closed issue #8816: ShardingSphere JDBC整合Spring Boot的BUG
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #8816:
URL: https://github.com/apache/shardingsphere/issues/8816
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org