Springboot中获取git提交信息,通过springboot actuator的/info endpoint查看
摘要:《Springboot Actuator之二:actuator在监控和管理指标的特性》 《Springboot中获取git提交信息,通过springboot actuator的/info endpoint查看》 项目中的代码放git上管理,jenkins的CICD的流水线打包发布下,经常容易忘记提交
阅读全文
posted @
2021-10-19 20:54
duanxz
阅读(1237)
推荐(0) 编辑
SPRING BOOT 注解之OBJECTPROVIDER源码追踪
摘要:最近依旧在学习阅读Spring Boot的源代码,在此过程中涉及到很多在日常项目中比较少见的功能特性,对此深入研究一下,也挺有意思,这也是阅读源码的魅力之一。这里写成文章,分享给大家。 自动配置中的ObjectProvider 在阅读Spring Boot自动配置源码中关于redis的配置时,看到这
阅读全文
posted @
2020-09-23 11:08
duanxz
阅读(793)
推荐(0) 编辑
Springboot Actuator之十二:actuator aop
摘要:前言spring 中aop是一个核心概念,spring boot 是如何实现自动化配置的?现在我们就来分析一下 解析spring boot 中自动化配置是读取/META-INF/spring.factories 中读取org.springframework.boot.autoconfigure.En
阅读全文
posted @
2019-08-09 17:42
duanxz
阅读(727)
推荐(0) 编辑
Springboot Actuator之十一:actuator transaction
摘要:前言spring boot 的自动化配置其实就是在spring 的基础上做的封装,在我们之前对mvc,aop的自动化配置中可以发现–> 只是在spring 的基础上添加了一些特性,可以认为只是一个spring的应用.那么,关于transaction的配置也同样. 解析和aop自动配置一样,在/MET
阅读全文
posted @
2019-08-09 17:39
duanxz
阅读(654)
推荐(0) 编辑
Springboot Actuator之十一:actuator PublicMetrics
摘要:前言接下来的几篇文章我们来分析一下spring-boot-actuator 中在org.springframework.boot.actuate.metrics中的代码,如图: 这里的代码不仅多,而且还比较复杂(类与类之间的关联关系).我们的策略是一点一点的蚕食,本文就先来分析PublicMetri
阅读全文
posted @
2019-08-09 17:37
duanxz
阅读(1840)
推荐(0) 编辑
Springboot Actuator之十:actuator中的audit包
摘要:前言这篇文章我们来分析一下org.springframework.boot.actuate.security,org.springframework.boot.actuate.audit中的代码,这2个包的类是对spring security 的事件进行处理的.类图如下: 二、源码解析 2.1、Au
阅读全文
posted @
2019-08-09 16:09
duanxz
阅读(2258)
推荐(0) 编辑
Springboot Actuator之九:actuator jmx endpoint
摘要:1、配置 2、结果: 自定义Bean,通过JMX暴露 下面的controller为了测试,改变数据, 结果:
阅读全文
posted @
2019-08-06 17:54
duanxz
阅读(1221)
推荐(0) 编辑
Springboot Actuator之八:actuator的执行原理
摘要:本文接着《Springboot Actuator之七:actuator 中原生endpoint源码解析1》,前面主要分析了原生endpoint的作用。 现在着重了解actuator的执行原理。 在前面一篇文章中,我们已经了解endpoint的暴露方式有http(spring MVC)协议,jmx协议
阅读全文
posted @
2019-08-05 18:06
duanxz
阅读(6977)
推荐(1) 编辑
Springboot Actuator之七:actuator 中原生endpoint源码解析1
摘要:看actuator项目的包结构,如下: 本文中的介绍Endpoints。 Endpoints(端点)介绍 Endpoints 是 Actuator 的核心部分,它用来监视应用程序及交互,spring-boot-actuator中已经内置了非常多的Endpoints(health、info、beans
阅读全文
posted @
2019-08-05 11:41
duanxz
阅读(6043)
推荐(0) 编辑
spring boot 源码解析52-actuate中MVCEndPoint解析
摘要:今天有个别项目的jolokia的endpoint不能访问,调试源码发现:endpoint.enabled的开关导致的。 关于Endpoint, 《Springboot Endpoint之二:Endpoint源码剖析》 之前的几篇文章分析了spring boot 中有关endpoint的实现,细心的朋
阅读全文
posted @
2019-08-02 17:55
duanxz
阅读(1064)
推荐(0) 编辑
SpringBoot扩展点之一:SpringApplicationRunListener
摘要:三种监听器的关系 ApplicationListener、SpringApplicationRunListeners、SpringApplicationRunListener的关系: SpringApplicationRunListeners类和SpringApplicationRunListene
阅读全文
posted @
2019-07-26 18:12
duanxz
阅读(13689)
推荐(5) 编辑
SpringBoot扩展点之二:ApplicationRunner和CommandLineRunner的扩展
摘要:一、Spring初始化 应用场景:在spring容器启动完成后做一些初始化的动作(如加载数据等),常见的办法有: 定义静态常量,随着类的生命周期加载而提前加载(这种方式可能对于工作经验较少的伙伴,选择是最多的); 实现CommandLineRunner接口;容器启动之后,加载实现类的逻辑资源,已达到
阅读全文
posted @
2019-07-26 17:24
duanxz
阅读(5377)
推荐(1) 编辑
SpringBoot扩展点之三:SpringBootServletInitializer扩展
摘要:SpringBootServletInitializer 熟悉了SpringApplication的原理之后,我们再来了解SpringBootServletInitializer的原理就比较容易了。 public class ServletInitializer extends SpringBoot
阅读全文
posted @
2019-07-24 16:35
duanxz
阅读(7011)
推荐(0) 编辑
SpringApplication常见用法说明
摘要:启动方式 方式1:在main方法中执行SpringApplication.run()这种方式来启动我们的工程 方式二:SpringApplication.run()的底层其实就是new了一个SpringApplication的对象 方式三:SpringApplicationBuilder 有时我们需
阅读全文
posted @
2019-07-23 18:16
duanxz
阅读(10427)
推荐(0) 编辑
SpringBoot源码分析之SpringBoot的启动过程
摘要:先看示例 SpringBoot的启动很简单,在许多情况下,你可以委托给静态SpringApplication.run方法,代码如下: @SpringBootApplication public class MyApplication { public static void main(String[
阅读全文
posted @
2019-07-23 11:05
duanxz
阅读(1936)
推荐(0) 编辑
Spring Boot Actutaur + Telegraf + InFluxDB + Grafana 构建监控平台
摘要:完成一套精准,漂亮图形化监控系统从这里开始第一步 为啥选择这些组件 Jolokia: Spring Boot 认可使用Jolokia来通过HTTP导出export JMX数据。你只需要在工程类路径中增加一些依赖项,一切都是开箱即用的。不需要任何额外的实现。 Telegraf: Telegraf支持通
阅读全文
posted @
2019-02-25 18:55
duanxz
阅读(2153)
推荐(1) 编辑
Springboot Endpoint之二:Endpoint源码剖析
摘要:spring boot 中有关endpoint的实现,细心的朋友可以发现,在org.springframework.boot.actuate.endpoint.mvc 包下也有一系列的xxxEndpoint,这又是为什么呢? 原因是: 我们很多情况下,都是访问接口的方式获取应用的监控,之前的分析是其
阅读全文
posted @
2018-12-27 18:54
duanxz
阅读(4961)
推荐(1) 编辑
spring boot 2.0.0由于版本不匹配导致的NoSuchMethodError问题解析
摘要:spring boot升级到2.0.0以后,项目突然报出 NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init> 异常,跟踪源代码无果的情况下。突然想到有可能是spring boot 和
阅读全文
posted @
2018-09-25 18:31
duanxz
阅读(1195)
推荐(0) 编辑