我是要查多数据源是否被创建bean才用到的,记录下
1、确保依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2、开放端口
management:
endpoints:
web:
exposure:
include: "*"
3、访问地址,如果系统有自定义的认证体系也需要放开该路径
server:
port: 8866
servlet:
context-path: /
如果你的端口和根是上述配置,就可以这样访问
http://localhost:8866/actuator/beans
返回报文就是所有的bean
其他功能请访问http://localhost:8866/actuator
会返回所有的功能接口
{
"_links" : {
"beans" : {
"href" : "http://localhost:8866/actuator/beans" ,
"templated" : false
} ,
"caches" : {
"href" : "http://localhost:8866/actuator/caches" ,
"templated" : false
} ,
"caches-cache" : {
"href" : "http://localhost:8866/actuator/caches/{cache}" ,
"templated" : true
} ,
"conditions" : {
"href" : "http://localhost:8866/actuator/conditions" ,
"templated" : false
} ,
"configprops" : {
"href" : "http://localhost:8866/actuator/configprops" ,
"templated" : false
} ,
"env" : {
"href" : "http://localhost:8866/actuator/env" ,
"templated" : false
} ,
"env-toMatch" : {
"href" : "http://localhost:8866/actuator/env/{toMatch}" ,
"templated" : true
} ,
"health" : {
"href" : "http://localhost:8866/actuator/health" ,
"templated" : false
} ,
"health-path" : {
"href" : "http://localhost:8866/actuator/health/{*path}" ,
"templated" : true
} ,
"heapdump" : {
"href" : "http://localhost:8866/actuator/heapdump" ,
"templated" : false
} ,
"info" : {
"href" : "http://localhost:8866/actuator/info" ,
"templated" : false
} ,
"loggers" : {
"href" : "http://localhost:8866/actuator/loggers" ,
"templated" : false
} ,
"loggers-name" : {
"href" : "http://localhost:8866/actuator/loggers/{name}" ,
"templated" : true
} ,
"mappings" : {
"href" : "http://localhost:8866/actuator/mappings" ,
"templated" : false
} ,
"metrics" : {
"href" : "http://localhost:8866/actuator/metrics" ,
"templated" : false
} ,
"metrics-requiredMetricName" : {
"href" : "http://localhost:8866/actuator/metrics/{requiredMetricName}" ,
"templated" : true
} ,
"scheduledtasks" : {
"href" : "http://localhost:8866/actuator/scheduledtasks" ,
"templated" : false
} ,
"self" : {
"href" : "http://localhost:8866/actuator" ,
"templated" : false
} ,
"threaddump" : {
"href" : "http://localhost:8866/actuator/threaddump" ,
"templated" : false
}
}
}