Blog Articles
-
spring cloud gateway 配置分析
srping cloud gateway 版本: 2.0.2 自动配置类列表spring.factories # Auto Configure org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.cloud.gateway.config.GatewayClassPathWarnin...
Published on: -
微服务基于请求的异步日志跟踪
在<<微服务基于请求的日志跟踪>>上设计了基于请求的微服务日志处理方法, 但是发现在log4j处于异步的情况下会失效, 原因是RequestId无法从原线程传输到打印日志的线程, 异步情况下(AsyncLoggerConfig), 日志先被enqueue到一个队列,然后若干线程去消费这个队列, 因为跨了线程,所以不能通过线程变量传递过去. 查看了相关代码, 发现log4j首...
Published on: -
微服务网关spring cloud gateway
<p>文档:<br /> <a href="https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.0.2.RELEASE/single/spring-cloud-gateway.html" target="_blank">https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.0.2.RELEASE/single/spring-cloud-gatewa
Published on: -
微服务基于请求的日志跟踪
<h1><a id="_0"></a>需求</h1> <p>自从公司采用微服务架构以后,日志不好看了, 虽然已经把所有日志都收集到了elk, 但是因为一个前端的请求通过N个服务,导致日志分布很零乱,没有办法显示这一个请求相关的日志,所以需要开发一点小功能来实现单个请求的跟踪.</p> <h1><a id="_3"></a>设计</h1> <p>基本的想法是, 对每个请求设置一个RequestId, 然后让这个id跟随请求传输到每个服务,进而打印到日志中. 需要解决以下问题:<br /> 1.请求id的隔离;
Published on: -
RocketMq ConsumerGroup Tag对消费的影响
<p>官方对consumer的定义如下:<br /> Similar to previously mentioned producer group, consumers of the exactly same role are grouped together and named Consumer Group.<br /> Consumer Group is a great concept with which achieving goals of load-balance and fault-tolera
Published on: -
thymeleaf (1) 环境配置
引入 简单博客页面,使用vue开发,发现不好做SEO, 打算用thymeleaf再写下。 导入相当简单: implementation 'org.springframework.boot:spring-boot-starter-thyme
Published on: -
mysql 快速数据导出与导入
背景 最近需要做表数据的更新,从几个表中抽取数据插入到新表,大概就是: insert into table_a(c1,c2 ...) select x1,x2.... from table_b join table_c on ...
Published on: -
集成spring cloud config后优先使用本地配置
集成spring clound config时默认情况下,远程配置会覆盖本地配置(除非是命令行参数)。 如果要优先使用本地配置,需要在远程配置中加入一些参数。 spring.cloud.config.allow-override=true(允许被覆盖) s
Published on: -
会员生日提前了一天
背景 有一天,收到反馈,某些用户的生日提前了一天(变成了前一天的23:00:00), 比如填写生日"1988-08-20",数据库中变成了"1988-08-19 23:00:00" 创建容器的时候,指定了系统时区为A
Published on: -
高CPU问题排查
某天,程序无响应 使用docker stats 查看容器发现CPU占用超高 使用top命令查看CPU占用最高的线程, top命令在procps包里,如果没有需要安装一下 apt update apt install procps top -H -p 1
Published on: