Skip to content

Commit 511f311

Browse files
authored
Merge pull request #53 from hengboy/2.3.x
Exclude default data source: HikariCP
2 parents c6aeb67 + d077043 commit 511f311

File tree

3 files changed

+32
-6
lines changed
  • api-boot-project/api-boot-starters/api-boot-starter-datasource-switch
  • api-boot-samples/api-boot-sample-datasource-switch

3 files changed

+32
-6
lines changed

api-boot-project/api-boot-starters/api-boot-starter-datasource-switch/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
<dependency>
3535
<groupId>org.springframework.boot</groupId>
3636
<artifactId>spring-boot-starter-jdbc</artifactId>
37+
<exclusions>
38+
<exclusion>
39+
<groupId>com.zaxxer</groupId>
40+
<artifactId>HikariCP</artifactId>
41+
</exclusion>
42+
</exclusions>
3743
</dependency>
3844
<dependency>
3945
<groupId>org.springframework.boot</groupId>

api-boot-samples/api-boot-sample-datasource-switch/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
<dependency>
2222
<groupId>org.minbox.framework</groupId>
2323
<artifactId>api-boot-starter-datasource-switch</artifactId>
24+
<exclusions>
25+
<exclusion>
26+
<groupId>org.minbox.framework</groupId>
27+
<artifactId>minbox-datasource-switch</artifactId>
28+
</exclusion>
29+
</exclusions>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.minbox.framework</groupId>
33+
<artifactId>minbox-datasource-switch</artifactId>
34+
<version>1.0.1-SNAPSHOT</version>
2435
</dependency>
2536
<!--SpringBoot Test-->
2637
<dependency>
@@ -32,6 +43,14 @@
3243
<groupId>mysql</groupId>
3344
<artifactId>mysql-connector-java</artifactId>
3445
</dependency>
46+
<dependency>
47+
<groupId>com.alibaba</groupId>
48+
<artifactId>druid</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>com.zaxxer</groupId>
52+
<artifactId>HikariCP</artifactId>
53+
</dependency>
3554
<!--性能测试依赖-->
3655
<dependency>
3756
<groupId>org.databene</groupId>

api-boot-samples/api-boot-sample-datasource-switch/src/main/resources/application.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ api:
66
datasource:
77
# 默认的数据源,默认值为master
88
primary: master
9-
# 配置使用hikari数据源
109
hikari:
10+
# slave 2
11+
slave_2:
12+
url: jdbc:mysql://localhost:3306/iot-logging?characterEncoding=utf8&serverTimezone=Asia/Shanghai
13+
username: root
14+
password: 123456
15+
# 配置使用hikari数据源
16+
druid:
1117
# master datasource config
1218
master:
1319
url: jdbc:mysql://localhost:3306/test?characterEncoding=utf8&serverTimezone=Asia/Shanghai
@@ -20,8 +26,3 @@ api:
2026
url: jdbc:mysql://localhost:3306/iot-oauth?characterEncoding=utf8&serverTimezone=Asia/Shanghai
2127
username: root
2228
password: 123456
23-
# slave 2
24-
slave_2:
25-
url: jdbc:mysql://localhost:3306/iot-logging?characterEncoding=utf8&serverTimezone=Asia/Shanghai
26-
username: root
27-
password: 123456

0 commit comments

Comments
 (0)