mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
@@ -157,7 +157,7 @@ spring.datasource.druid.filter.wall.config.drop-table-allow=false
|
||||
|
||||
## Spring Boot Actuator Endpoints
|
||||
|
||||
可以使用下面配置类启用 endpoint 默认访问地址:`/druid-endpoint`,可以使用 `endpoints.druid.path=` 自定义终端地址
|
||||
可以使用下面配置类启用 endpoint 默认访问地址:`/actuator/druid`,可以使用 `endpoints.druid.path=` 自定义终端地址
|
||||
|
||||
```endpoints.druid.enabled=true```
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ Druid Spring Boot Starter will enable StatFilter by default, and you can also se
|
||||
|
||||
```endpoints.druid.enabled=true```
|
||||
|
||||
default endpoint address is : `/druid-endpoint`, can be used `endpoints.druid.path=` to customize it.
|
||||
default endpoint address is : `/actuator/druid`, can be used `endpoints.druid.path=` to customize it.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<properties>
|
||||
<druid.version>1.1.7</druid.version>
|
||||
<spring-boot.version>1.5.9.RELEASE</spring-boot.version>
|
||||
<spring-boot.version>1.5.10.RELEASE</spring-boot.version>
|
||||
</properties>
|
||||
|
||||
<developers>
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
public class DruidDataSourceMvcEndpoint extends AbstractMvcEndpoint {
|
||||
|
||||
public DruidDataSourceMvcEndpoint() {
|
||||
super("/druid-endpoint", true);
|
||||
super("/actuator/druid", true);
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
|
||||
+8
-2
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.alibaba.druid.spring.boot.testcase;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.spring.boot.demo.DemoApplication;
|
||||
import org.junit.Test;
|
||||
@@ -41,7 +43,9 @@ public class DruidMultiDataSourceTestCase {
|
||||
private DruidDataSource dataSourceTwo;
|
||||
|
||||
@Test
|
||||
public void testDataSourceOne() {
|
||||
public void testDataSourceOne() throws SQLException {
|
||||
dataSourceOne.init();
|
||||
|
||||
assertThat(dataSourceOne.getUrl()).isEqualTo("jdbc:h2:file:./demo-db");
|
||||
assertThat(dataSourceOne.getUsername()).isEqualTo("sa");
|
||||
assertThat(dataSourceOne.getPassword()).isEqualTo("sa");
|
||||
@@ -53,7 +57,9 @@ public class DruidMultiDataSourceTestCase {
|
||||
assertThat(dataSourceOne.getMaxWait()).isEqualTo(10000);
|
||||
}
|
||||
@Test
|
||||
public void testDataSourceTwo() {
|
||||
public void testDataSourceTwo() throws SQLException {
|
||||
dataSourceTwo.init();
|
||||
|
||||
assertThat(dataSourceTwo.getUrl()).isEqualTo("jdbc:h2:file:./demo-db");
|
||||
assertThat(dataSourceTwo.getUsername()).isEqualTo("sa");
|
||||
assertThat(dataSourceTwo.getPassword()).isEqualTo("sa");
|
||||
|
||||
@@ -25,7 +25,7 @@ spring.jpa.hibernate.ddl-auto=create-drop
|
||||
|
||||
# 更多配置属性见 DruidDataSource 内成员变量(只要有set方法便支持),或者根据IDE提示,或者查看官方文档
|
||||
|
||||
# 启用endpoint,默认访问地址:/druid-endpoint,可以使用endpoints.druid.path=自定义终端地址
|
||||
# 启用endpoint,默认访问地址:/actuator/druid,可以使用endpoints.druid.path=自定义终端地址
|
||||
endpoints.druid.enabled=true
|
||||
# 默认需要安全认证才可以访问,可以用下面两种方法之一来禁用安全认证,详情见 Spring Boot 官方文档
|
||||
endpoints.druid.sensitive=false
|
||||
|
||||
Reference in New Issue
Block a user