opened 10:23AM - 19 Jan 24 UTC
shardingjdbc 5.4.1
pom.xml
```xml
<dependency>
<groupI…d>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>5.4.1</version>
<exclusions>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.2.RELEASE</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
</exclusions>
</dependency>
```
The following two pictures `HINT` have different local configuration methods. When I use the method of picture 1 to configure, an error will be reported. (下面这两个图片 `HINT` 地方配置方式不一致,当我使用图片1的方式进行配置,会报错)
![image](https://github.com/apache/shardingsphere/assets/32268317/50f6202d-9f29-49d6-8ee9-09b618cf5bd8)
![image](https://github.com/apache/shardingsphere/assets/32268317/028d964d-9a86-43cf-91df-0e81c3394355)
sharding.yaml
![image](https://github.com/apache/shardingsphere/assets/32268317/be89627f-7c9d-4be3-8565-04c643816659)
error msg: (报错信息)
![image](https://github.com/apache/shardingsphere/assets/32268317/e9828feb-2ca2-46c0-a6ef-50683a5f667c)
And it will flush logs crazily, causing the CPU to increase and the fan to spin wildly.(并且会疯狂刷日志,导致CPU升高,风扇狂转)
---------------------------
When I use the other configuration in Picture 2, no error will be reported, but it will not enter my custom algorithm. If I specify two data sources, it will query two data sources, and if it is three, it will query three data sources.
(当我使用图片2的另一种方式配置,不会报错,但是不会进入我的自定义算法中,指定两个数据源,他就查询两个数据源,三个就查询三个数据源)
![image](https://github.com/apache/shardingsphere/assets/32268317/5f95bc7c-cb99-4ce2-a0dd-1eff15fbe13d)
查询
![image](https://github.com/apache/shardingsphere/assets/32268317/4b595b6b-883f-4efd-b93d-59214201aa51)
Custom algorithm
![image](https://github.com/apache/shardingsphere/assets/32268317/189ea5a6-43df-49ea-b0b5-2df25be49ee6)
question:
1. How should I configure the forced routing using hint? I want to implement the SAS architecture and multi-tenant function. By specifying the hint algorithm, I can obtain the corresponding user's library during execution, and the hint forcefully specifies the data source function.
(问题:
1、我到底应该怎样配置使用hint 强制路由,我是为了实现sas架构,多租户功能,通过指定hint算法,执行时获取对应用户所属库,hint强制指定数据源功能)
非常感谢!