gpt4 book ai didi

java - spring-cloud 如何使用Endpoints

转载 作者:行者123 更新时间:2023-12-02 11:52:51 26 4
gpt4 key购买 nike

management endpoints:

对于 Spring Boot Actuator 应用程序,还有一些额外的管理端点:

    POST to /env to update the Environment and rebind @ConfigurationProperties and log levels

http://localhost:8080/env/testprop它有效并返回:

{
"testprop": "test value"
}

但是当我发帖时:http://localhost:8080/env/testprop不支持请求方法“POST”

我想更新testprop,如何使用API​​​​进行?

最佳答案

我在 docs 中找到了以下内容

For a Spring Boot Actuator application there are some additional management endpoints:

  • POST to /env to update the Environment and rebind @ConfigurationProperties and log levels

  • /refresh for re-loading the boot strap context and refreshing the @RefreshScope beans

  • /restart for closing the ApplicationContext and restarting it (disabled by default)

  • /pause and /resume for calling the Lifecycle methods (stop() and start() on the ApplicationContext)

看起来您必须再次发布/env 而不是/end/$yourProperty

关于java - spring-cloud 如何使用Endpoints,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47772459/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com