Open sxm20074428 opened 6 years ago
springboot2加强了actuator功能,通过annotation+配置即可暴露对应的endpoint。 e.g.
actuator
@Component @Endpoint(id = "properties") public class PropertiesAction { @ReadOperation public Object loadAllProperties() { try { return PropertiesLoaderUtils.loadAllProperties("application.properties"); } catch (IOException e) { return "read application fail! error: " + e.getMessage(); } } }
management.server.port=9527 management.server.address=localhost management.endpoints.web.base-path=/endpoint management.endpoints.web.exposure.include=*
curl http://localhost:9527/endpoint/properties
springboot2加强了
actuator
功能,通过annotation+配置即可暴露对应的endpoint。 e.g.