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

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条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!