摘要: 20220921 sdk服务有一段根据url是否带参数的判断的实际代码: maven 加载 jar包后,运行都有报错,查看源码: 直接省略了 对url的判断, 导致 url 没有加参数的 场景都会 抛 数组越界异常。 解决方案 添加log改变优化的行为: 查看源码,正常: 再次运行服务也是正常。 总 阅读全文
posted @ 2022-09-28 15:16 小烽 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 1、自建 starter 的一些关于 maven 的记录。 可以减小 jar 包的大小,不做依赖传递 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifact 阅读全文
posted @ 2022-09-02 13:53 小烽 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 背景: 需要从 kafka 消费大量的流量数据, 写入promehteus。 通过直接写, 可以减少 消费和prometheus pull的 交互。 参考文章: 1、实操见 Prometheus Remote Write in Java, 但上面是 remote reader的demo 2、Prom 阅读全文
posted @ 2022-07-22 19:05 小烽 阅读(1203) 评论(1) 推荐(0) 编辑
摘要: 背景: 需要自定义 时间戳,目前查阅,只能通过 底层的操作才支持 带 自定义的时间戳。 前提: 下载安装 prometheus,见 1、新建springboot项目 <!-- The client --> <dependency> <groupId>io.prometheus</groupId> < 阅读全文
posted @ 2022-07-22 19:03 小烽 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 查看视频 和 网上的文档,下载了对应的版本,但是编译一直有问题。版本如下: kakfa版本 :0.10.0.1 scalan:2.10.6 gradle:3.1 根据提示,不断的修正 版本, 和 修改 build.gradle 和 gradle.script 配置. Gradle 从 3.1 到 7 阅读全文
posted @ 2021-09-06 09:33 小烽 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 背景 先看一段代码: @Transactional(rollbackFor = Exception.class) public boolean cancel(OrderRequest request) { long start = System.currentTimeMillis(); String 阅读全文
posted @ 2020-11-27 22:22 小烽 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 背景 在项目中, 通过一个 orderId 字段来 贯穿 订单的一个执行过程。 通过 这个 orderId 可以解决 90%的问题排查效率问题,也不需要去 去定义 在 分布式系统中的一个 业务 id。 在刚开始时,业务简单,都是在 log.info 中 人工去写: 存在两个问题: 1、随着代码量越来 阅读全文
posted @ 2020-09-28 16:51 小烽 阅读(2080) 评论(0) 推荐(0) 编辑
摘要: 背景 ​ 想重新执行下 以前写的 mock 测试类,发生了一堆的问题,进行部分的梳理和深究。 1、执行mock方法时 异常 org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: class com. 阅读全文
posted @ 2020-09-22 11:27 小烽 阅读(1586) 评论(0) 推荐(0) 编辑
摘要: 背景 public static void main(String[] args) { String netmask = "103.140.147.0/24"; System.out.println(org.springframework.util.StringUtils.split(netmask 阅读全文
posted @ 2020-09-09 15:24 小烽 阅读(1274) 评论(0) 推荐(1) 编辑
摘要: 添加接口后,启动报错 2020-09-04 10:35:35,370] [WARN] [] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Except 阅读全文
posted @ 2020-09-04 13:37 小烽 阅读(705) 评论(0) 推荐(0) 编辑