Spring Boot Endpoint

Spring Boot 的 Endpoints 带着强烈的 DevOps 色彩, “you build it, you run it” ,开发不仅要关心如何实现功能,还需要关心服务在线上运行的状态,如果缺乏实时监控,维护线上服务必然是一场噩梦。

 

 

/**
 * An endpoint that can be used to expose useful information to operations. Usually
 * exposed via Spring MVC but could also be exposed using some other technique. Consider
 * extending {@link AbstractEndpoint} if you are developing your own endpoint.
 *
 * @param <T> the endpoint data type
 * @author Phillip Webb
 * @author Dave Syer
 * @author Christian Dupuis
 * @see AbstractEndpoint
 */
public interface Endpoint<T> {

    /**
     * The logical ID of the endpoint. Must only contain simple letters, numbers and '_'
     * characters (i.e. a {@literal "\w"} regex).
     * @return the endpoint ID
     */
    String getId();

    /**
     * Return if the endpoint is enabled.
     * @return if the endpoint is enabled
     */
    boolean isEnabled();

    /**
     * Return if the endpoint is sensitive, i.e. may return data that the average user
     * should not see. Mappings can use this as a security hint.
     * @return if the endpoint is sensitive
     */
    boolean isSensitive();

    /**
     * Called to invoke the endpoint.
     * @return the results of the invocation
     */
    T invoke();

}

 

 

 demo

https://412887952-qq-com.iteye.com/blog/2380027

 

 

 


 

Springboot admin 

 

ref

https://docs.spring.io/spring-boot/docs/1.1.x/reference/htmlsingle/#production-ready-endpoints

https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

转载于:https://www.cnblogs.com/huilei/p/10255398.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值