diff --git a/backend/src/main/java/com/cruru/config/DataSourceConfig.java b/backend/src/main/java/com/cruru/config/DataSourceConfig.java index 847e1d753..f1238ad6f 100644 --- a/backend/src/main/java/com/cruru/config/DataSourceConfig.java +++ b/backend/src/main/java/com/cruru/config/DataSourceConfig.java @@ -42,7 +42,7 @@ public DataSourceRouter routeDataSource() { } @Bean(name = WRITE_DATASOURCE) - @ConfigurationProperties(prefix = "spring.datasource.write") + @ConfigurationProperties(prefix = "spring.datasource.write.hikari") public DataSource writeDataSource() { return DataSourceBuilder.create() .type(HikariDataSource.class) @@ -50,7 +50,7 @@ public DataSource writeDataSource() { } @Bean(name = READ_DATASOURCE) - @ConfigurationProperties(prefix = "spring.datasource.read") + @ConfigurationProperties(prefix = "spring.datasource.read.hikari") public DataSource readDataSource() { return DataSourceBuilder.create() .type(HikariDataSource.class) diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index f41091e0c..40bd3f887 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -12,9 +12,11 @@ spring: enabled: true datasource: read: - jdbc-url: jdbc:h2:mem:database;MODE=MySQL; + hikari: + jdbc-url: jdbc:h2:mem:database;MODE=MySQL; write: - jdbc-url: jdbc:h2:mem:database;MODE=MySQL; + hikari: + jdbc-url: jdbc:h2:mem:database;MODE=MySQL; flyway: enabled: false jpa: @@ -81,15 +83,17 @@ spring: on-profile: dev datasource: read: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} write: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} flyway: enabled: true baseline-on-migrate: true @@ -178,15 +182,19 @@ spring: on-profile: test datasource: read: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} + maximum-pool-size: 10 write: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} + maximum-pool-size: 5 flyway: enabled: true baseline-on-migrate: true @@ -273,15 +281,19 @@ spring: on-profile: prod datasource: read: - jdbc-url: ${READ_DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${READ_DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} + maximum-pool-size: 10 write: - jdbc-url: ${WRITE_DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} + hikari: + jdbc-url: ${WRITE_DB_URL} + driver-class-name: com.mysql.cj.jdbc.Driver + username: ${DB_USER} + password: ${DB_PASSWORD} + maximum-pool-size: 5 flyway: enabled: true baseline-on-migrate: true diff --git a/backend/src/test/resources/application.yml b/backend/src/test/resources/application.yml index 2201cc1d8..89148a14f 100644 --- a/backend/src/test/resources/application.yml +++ b/backend/src/test/resources/application.yml @@ -7,9 +7,11 @@ spring: enabled: true datasource: read: - jdbc-url: jdbc:h2:mem:database;MODE=MySQL; + hikari: + jdbc-url: jdbc:h2:mem:database;MODE=MySQL; write: - jdbc-url: jdbc:h2:mem:database;MODE=MySQL; + hikari: + jdbc-url: jdbc:h2:mem:database;MODE=MySQL; flyway: enabled: false jpa: