随笔分类 -  java / 框架 / SpringCloud

1
摘要:Navicat 下查看 rollback_info 1. 右键复制 2. Json 格式化【前置镜像:before image、后置镜像:after image】 { "@class": "io.seata.rm.datasource.undo.BranchUndoLog", "xid": "192 阅读全文
posted @ 2023-12-24 18:28 爱新觉罗LQ 阅读(138) 评论(0) 推荐(0) 编辑
摘要:启用微服务报错:Method has too many Body parameters package com.llq.springcloud.controller; @RestController public class StorageController { @Resource private 阅读全文
posted @ 2023-12-19 16:24 爱新觉罗LQ 阅读(54) 评论(0) 推荐(0) 编辑
摘要:Order微服务通过 opneFeign 调用 storage 和 account 时报错 原因分析: 服务名称不能有下划线,可以使用中划线,Springcloud无法识别下划线,将下划线改为中划线即可 注意:这个改了之后,你在进行远程调用的时候,接口对应的方法接口也需要相应改变【分布式开发,一个微 阅读全文
posted @ 2023-12-19 16:13 爱新觉罗LQ 阅读(322) 评论(0) 推荐(0) 编辑
摘要:Error creating bean with name ‘globalTransactionScanner‘ defined in class path resource [io/seata/sp https://blog.csdn.net/qq_36440982/article/details 阅读全文
posted @ 2023-12-18 12:27 爱新觉罗LQ 阅读(693) 评论(0) 推荐(0) 编辑
摘要:SpringCloud Seata【解决分布式事务的问题】安装 1. 问题引出 1.1 单机单库(多表)处理事务示意图 1.2 分布式微服务架构下的数据库事务示意图 图片梳理:用户购买商品的业务逻辑。整个业务逻辑由3个微服务提供支持: 仓库服务:对给定商品 扣除商品数量 订单服务:根据采购需求创建订 阅读全文
posted @ 2023-12-14 11:56 爱新觉罗LQ 阅读(27) 评论(0) 推荐(0) 编辑
摘要:规则持久化【结合 Nacos】 如果 sentinel 流控规则没有持久化,当重启调用API/接口所在微服务后,规则就会丢失,需要重新加入 需求: 为member-service-nacos-consumer-81 微服务的/member/openfeign/consumer/get/1 API 接 阅读全文
posted @ 2023-12-13 10:00 爱新觉罗LQ 阅读(14) 评论(0) 推荐(0) 编辑
摘要:openFeign+sentinel 对远程调用熔断降级 需求: 在member-service-nacos-consumer-80 调用某个无效服务时,启动Sentinel的熔断降级机制, 能够快速返回响应,而不是使用默认的超时机制(因为超时机制容易线程堆积, 从而导致雪崩) 异常场景 1. 两个 阅读全文
posted @ 2023-12-12 12:47 爱新觉罗LQ 阅读(130) 评论(0) 推荐(0) 编辑
摘要:服务消费者整合 Sentinel【这样 Sentinel才能对服务消费者进行监控和保护】 需求:在member-service-nacos-consumer-81 整合Sentinel,能被Sentinel 监控和保护 Sentinel 相关配置 1. xml <!-- 引入 alibaba-sen 阅读全文
posted @ 2023-12-11 16:34 爱新觉罗LQ 阅读(7) 评论(0) 推荐(0) 编辑
摘要:服务消费者整合 OpenFeign > 启动类中要添加 @EnableFeignClients 注解 package com.llq.springcloud; @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @E 阅读全文
posted @ 2023-12-11 12:38 爱新觉罗LQ 阅读(50) 评论(0) 推荐(0) 编辑
摘要:Postman 模拟高并发访问 1. 将请求放到集合中 > Run collection 可以算出 QPS = 1 / 02 = 5 次 / 秒 阅读全文
posted @ 2023-12-02 13:14 爱新觉罗LQ 阅读(689) 评论(0) 推荐(0) 编辑
摘要:URL 资源清洗 在 Controller 包中建立一个新的类,并实现 UrlCleaner 接口 package com.llq.springcloud.controller; @Component public class CustomUrlCleaner implements UrlClean 阅读全文
posted @ 2023-12-01 19:44 爱新觉罗LQ 阅读(25) 评论(0) 推荐(0) 编辑
摘要:问题 原因:引错包了!!! 应该引入如下这个包 import feign.Logger; 阅读全文
posted @ 2023-09-28 12:16 爱新觉罗LQ 阅读(63) 评论(0) 推荐(0) 编辑
摘要:![](https://img2023.cnblogs.com/blog/2171496/202309/2171496-20230925170645648-768512828.png) 阅读全文
posted @ 2023-09-25 17:07 爱新觉罗LQ 阅读(13) 评论(0) 推荐(0) 编辑
摘要:抽取共用API类,并用 Maven打包成 jar 可以解压e_commerce....jar 可以看到打包后的.class 文件 测试成功!!! 阅读全文
posted @ 2023-09-21 11:05 爱新觉罗LQ 阅读(17) 评论(0) 推荐(0) 编辑
摘要:SpringCloud修改子模块名称 1. Rename module and directory 2. 修改 pom.xml 中对应的名称 阅读全文
posted @ 2023-09-21 09:34 爱新觉罗LQ 阅读(23) 评论(0) 推荐(0) 编辑
摘要:新版的2020 的IDEA 当你同时启动两个微服务时,不会弹出启动Run Dashboard 窗口的提示,是因为IDEA2020 将Run Dashboard 添加到控制台Service 中 1. 找到你的项目/.idea/workspace.xml 文件在其中添加下面的代码即可 <componen 阅读全文
posted @ 2023-09-21 00:08 爱新觉罗LQ 阅读(113) 评论(0) 推荐(0) 编辑
摘要:添加会员后,数据库中为 null 解决方案 加入注解 @RequestBody,可以将通过 restTemplate 发送的数据重新封装成 Member 重新添加后,发现1添加正常!!! 阅读全文
posted @ 2023-09-20 20:00 爱新觉罗LQ 阅读(10) 评论(0) 推荐(0) 编辑
摘要:原因 其实这个异常在SpringBoot中是一个比较常见的异常,一般是因为SpringBoot自动配置时,检测到我们添加了MySQL、Oracle、Mybatis等和数据库相关的依赖包,结果我们的配置文件中却没有添加数据库相关的配置,比如: spring: datasource: driver-cl 阅读全文
posted @ 2023-09-20 18:38 爱新觉罗LQ 阅读(2293) 评论(0) 推荐(0) 编辑
摘要:RestTemplate 基本介绍 RestTemplate 是Spring 提供的用于访问Rest 服务的模板类 RestTemplate 提供了多种便捷访问远程Http 服务的方法 老韩说明:小伙伴可以这样理解, 通过RestTemplate, 我们可以发出http 请求(支持Restful 风 阅读全文
posted @ 2023-09-18 15:07 爱新觉罗LQ 阅读(18) 评论(0) 推荐(0) 编辑

1
点击右上角即可分享
微信分享提示