前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Production-Ready特性

Production-Ready特性

作者头像
星哥玩云
发布2022-09-15 14:03:21
1.2K0
发布2022-09-15 14:03:21
举报
文章被收录于专栏:开源部署开源部署

1、理解Production-Ready特性

1.1、理解Production-Ready一般性定义

Prodcution-Ready是DevOps的立足点,具有metrics(指标)、health checks(健康检查)和externalized configuration(外部配置)等生产特性。

1.2、理解Spring Boot Actuator

Spring Boot Actuator用于监控和管理Spring应用,可通过HTTP Endpoint (Endpoint是用户订阅主题时,指定接收消息的终端地址;当有消息发布到主题时,消息中间件会主动将消息推送到对应的 Endpoint; 多个Subscription可以指定同一个Endpoint)或 JMX Bean(JMX是一个Java的管理工具,可以实现的功能主要是对Java程序的管理)与其交互。z

1.3、Spring Boot Actuator Endpoints

Spring Boot Actuator 并非默认存在,而需要手动地添加依赖至项目pom.xml文件中,pom.xml文件如下:

代码语言:javascript
复制
        <!--actuator-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
1.3.1、显示当前Spring应用上下文的Spring Bean 完整列表
代码语言:javascript
复制
#在application.properties中添加
management.endpoints.web.exposure.include=beans

访问http://localhost:8080/actuator/beans

1.3.2、显示当前应用所有配置类和自动装配类的条件评估结果和暴露Spring ConfigurableEnvironment中的PropertySource属性
代码语言:javascript
复制
/*添加@ConditionalOnWebApplication表示在Web应用中*/
@ConditionalOnWebApplication
@Configuration
@Import(WebConfig.class)
public class WebAutoConfiguration {
}
代码语言:javascript
复制
#在application.properties中添加
management.endpoints.web.exposure.include=beans,conditions,env

访问http://localhost:8080/actuator/conditions

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1、理解Production-Ready特性
    • 1.1、理解Production-Ready一般性定义
      • 1.2、理解Spring Boot Actuator
        • 1.3、Spring Boot Actuator Endpoints
          • 1.3.1、显示当前Spring应用上下文的Spring Bean 完整列表
          • 1.3.2、显示当前应用所有配置类和自动装配类的条件评估结果和暴露Spring ConfigurableEnvironment中的PropertySource属性
      相关产品与服务
      消息队列 TDMQ
      消息队列 TDMQ (Tencent Distributed Message Queue)是腾讯基于 Apache Pulsar 自研的一个云原生消息中间件系列,其中包含兼容Pulsar、RabbitMQ、RocketMQ 等协议的消息队列子产品,得益于其底层计算与存储分离的架构,TDMQ 具备良好的弹性伸缩以及故障恢复能力。
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档