This commit is contained in:
trang
2018-01-31 16:22:24 +08:00
parent 0b63cec519
commit 6e5e3218cf
4 changed files with 5 additions and 75 deletions
@@ -17,16 +17,10 @@ import java.util.Map;
* @author trang
*/
@Configuration
@Profile({"dynamic", "dynamic-dev-yaml", "dynamic-dev-props"})
@Profile("dynamic")
@Slf4j
public class SpringDataSourceConfig {
// @Bean
// public DruidDataSourceCustomizer druidDataSourceCustomizer() {
// System.out.println("DruidDataSourceCustomizer...");
// return (dataSource) -> dataSource.setMaxActive(66);
// }
@Bean
@Primary
public DynamicDataSource dataSource(Map<String, DruidDataSource> druidDataSourceMap) {
@@ -86,13 +86,6 @@ spring:
debug: true
spring:
profiles: default
---
debug: true
spring:
profiles: dynamic
autoconfigure:
@@ -109,63 +102,4 @@ spring:
max-open-prepared-statements: 50
slave:
max-active: 25
max-open-prepared-statements: 25
---
spring:
profiles: config
datasource:
url: jdbc:h2:file:./samples
username: root
password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg==
schema: classpath:/import.sql
druid:
config:
enabled: true
---
spring:
profiles: features
datasource:
url: jdbc:h2:file:./samples
username: root
password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg==
schema: classpath:/import.sql
druid:
# 默认开启,当前已开启
stat:
log-slow-sql: true
slow-sql-millis: 1000
# 默认关闭,需手动开启,当前已开启
slf4j:
enabled: true
connection-log-enabled: false
statement-sql-format-option:
upp-case: true
pretty-format: false
statement-executable-sql-log-enable: true
result-set-log-enabled: false
# 默认关闭,需手动开启,当前已开启
wall:
enabled: true
log-violation: true
throw-exception: false
config:
delete-where-none-check: true
# 默认关闭,需手动开启,当前已开启
config:
enabled: true
# 默认关闭,需手动开启,当前已开启
web-stat:
enabled: true
# 默认关闭,需手动开启,当前已开启
aop-stat:
enabled: true
patterns:
- com.github.trang.*
# 默认关闭,需手动开启,当前已开启
stat-view-servlet:
enabled: true
reset-enable: true
max-open-prepared-statements: 25
@@ -81,6 +81,8 @@ spring:
mybatis:
type-aliases-package: com.github.trang.druid.example.mybatis.model
configuration:
map-underscore-to-camel-case: true
---
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>com.github.drtrang</groupId>
<artifactId>parent</artifactId>
<version>1.0.7</version>
<version>1.0.8-SNAPSHOT</version>
</parent>
<artifactId>druid-spring-boot-parent</artifactId>