fly-680 2019-03-11 16:55 采纳率: 100%
浏览 1968
已采纳

springboot集成actuator,找不到shutdown

1、springboot版本2.1.3

2、pom.xml加了

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

3、application.properties加了

management.endpoints.shutdown.enabled=true
management.endpoints.shutdown.sensitive=false
management.endpoints.web.exposure.include=*

4、请求http://127.0.0.1:8222/actuator/
返回值:

{
    "_links": {
        "self": {
            "href": "http://127.0.0.1:8222/actuator",
            "templated": false
        },
        "auditevents": {
            "href": "http://127.0.0.1:8222/actuator/auditevents",
            "templated": false
        },
        "beans": {
            "href": "http://127.0.0.1:8222/actuator/beans",
            "templated": false
        },
        "caches-cache": {
            "href": "http://127.0.0.1:8222/actuator/caches/{cache}",
            "templated": true
        },
        "caches": {
            "href": "http://127.0.0.1:8222/actuator/caches",
            "templated": false
        },
        "health-component-instance": {
            "href": "http://127.0.0.1:8222/actuator/health/{component}/{instance}",
            "templated": true
        },
        "health": {
            "href": "http://127.0.0.1:8222/actuator/health",
            "templated": false
        },
        "health-component": {
            "href": "http://127.0.0.1:8222/actuator/health/{component}",
            "templated": true
        },
        "conditions": {
            "href": "http://127.0.0.1:8222/actuator/conditions",
            "templated": false
        },
        "configprops": {
            "href": "http://127.0.0.1:8222/actuator/configprops",
            "templated": false
        },
        "env-toMatch": {
            "href": "http://127.0.0.1:8222/actuator/env/{toMatch}",
            "templated": true
        },
        "env": {
            "href": "http://127.0.0.1:8222/actuator/env",
            "templated": false
        },
        "info": {
            "href": "http://127.0.0.1:8222/actuator/info",
            "templated": false
        },
        "loggers": {
            "href": "http://127.0.0.1:8222/actuator/loggers",
            "templated": false
        },
        "loggers-name": {
            "href": "http://127.0.0.1:8222/actuator/loggers/{name}",
            "templated": true
        },
        "heapdump": {
            "href": "http://127.0.0.1:8222/actuator/heapdump",
            "templated": false
        },
        "threaddump": {
            "href": "http://127.0.0.1:8222/actuator/threaddump",
            "templated": false
        },
        "metrics": {
            "href": "http://127.0.0.1:8222/actuator/metrics",
            "templated": false
        },
        "metrics-requiredMetricName": {
            "href": "http://127.0.0.1:8222/actuator/metrics/{requiredMetricName}",
            "templated": true
        },
        "scheduledtasks": {
            "href": "http://127.0.0.1:8222/actuator/scheduledtasks",
            "templated": false
        },
        "httptrace": {
            "href": "http://127.0.0.1:8222/actuator/httptrace",
            "templated": false
        },
        "mappings": {
            "href": "http://127.0.0.1:8222/actuator/mappings",
            "templated": false
        }
    }
}

并没有shutdown,post请求http://127.0.0.1:8222/actuator/shutdown也报404,请求是哪里还需要配置吗?

  • 写回答

2条回答 默认 最新

  • qingdao1528 2019-03-11 17:49
    关注

    endpoints 改为 endpoint

    management.endpoint.shutdown.enabled=true
    

    因为springboot的自动配置中:
    图片说明

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?