1 2 3 4 5 ··· 48 下一页
摘要: 前言 在使用SpringBoot的项目中,我们需要配置spring-boot-maven-plugin插件 <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artif 阅读全文
posted @ 2021-11-04 18:50 strongmore 阅读(8756) 评论(0) 推荐(0)
摘要: 使用 maven引入依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.14</version> </dependency> @Getter @Sette 阅读全文
posted @ 2020-07-11 10:48 strongmore 阅读(3749) 评论(4) 推荐(0)
摘要: 使用 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Log { String value(); } Target是java中的源注解,标识注解的使用位置,如类,方法,参数,变量等。 Re 阅读全文
posted @ 2020-07-11 10:35 strongmore 阅读(4260) 评论(0) 推荐(0)
摘要: 前言 项目中需要对数据库进行分库分表操作,所以使用sharding-jdbc来实现此功能 引入依赖 <dependency> <groupId>org.apache.shardingsphere</groupId> <artifactId>sharding-jdbc-spring-boot-star 阅读全文
posted @ 2026-04-11 14:36 strongmore 阅读(16) 评论(0) 推荐(0)
摘要: 使用介绍 execution(public * com.imooc..web...*(..)) 匹配哪些包下的哪些类的哪些方法 @annotation(com.imooc.product.aspectj.TimeCost) 匹配方法上的注解 @within(com.imooc.product.asp 阅读全文
posted @ 2026-04-01 22:57 strongmore 阅读(3) 评论(0) 推荐(0)
摘要: 错误描述 org.springframework.amqp.rabbit.support.ListenerExecutionFailedException: Failed to convert message at org.springframework.amqp.rabbit.listener.a 阅读全文
posted @ 2026-03-31 19:43 strongmore 阅读(6) 评论(0) 推荐(0)
摘要: 前言 LocationTech JTS 拓扑套件(JTS)是一个开源的 Java 软件库,提供了平面几何的对象模型以及一套基础的几何函数。JTS 遵循开放 GIS 联盟发布的 SQL 简单要素规范(Simple Features Specification for SQL)。JTS旨在作为基于矢量的 阅读全文
posted @ 2026-03-31 08:30 strongmore 阅读(22) 评论(0) 推荐(0)
摘要: 前言 之前项目中使用的唯一ID生成方式为雪花算法,但是该方式存在“需要动态分配机器标识”和”时钟回拨“的问题,且解决起来比较复杂,所以考虑切换实现方式为数据库号段,该方式参考美团开源的项目Leaf。具体原理为 每个服务实例第一次从数据库加载一个号段放到内存中,比如第一个实例1-1000,第二个实例1 阅读全文
posted @ 2026-01-01 13:03 strongmore 阅读(15) 评论(0) 推荐(0)
摘要: 问题描述 在使用tk提供的InsertMapper的insert方法时,不会将自增ID回写到记录中。 问题复现 maven依赖 <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</art 阅读全文
posted @ 2026-01-01 09:49 strongmore 阅读(24) 评论(0) 推荐(0)
摘要: 前言 雪花算法的构成为 第一位固定为0,表示正数 41位表示时间戳,一共可以使用69年 5位表示数据中心节点,5位表示机器标识,一共可以支持1024个节点 12位表示一毫秒内的序列号,共4096个 如果多个服务实例使用的数据中心和机器标识都一样,那么在高并发情况下会生成重复的ID,这个问题是很严重的 阅读全文
posted @ 2025-12-30 21:43 strongmore 阅读(28) 评论(0) 推荐(0)
摘要: 问题描述 使用 rabbitmq_delayed_message_exchange 插件时,ReturnCallback 会被强制触发,错误码302,错误信息为NO_ROUTE。 问题复现 spring配置如下 spring.rabbitmq.host= spring.rabbitmq.port= 阅读全文
posted @ 2025-12-29 22:06 strongmore 阅读(25) 评论(0) 推荐(0)
摘要: 数据准备 @RestController @RequestMapping("/api") @Slf4j public class HealthController { @GetMapping("/health") public String health(@RequestBody TestVO te 阅读全文
posted @ 2025-07-04 20:14 strongmore 阅读(22) 评论(0) 推荐(0)
摘要: 数据准备 定义一个AOP拦截器来打印日志,在接口执行完和执行抛异常时都会打印 @Slf4j @Aspect @Component public class ApiLogAspect { @Around("@annotation(com.imooc.ApiLog)") public Object do 阅读全文
posted @ 2025-07-04 20:13 strongmore 阅读(22) 评论(0) 推荐(0)
1 2 3 4 5 ··· 48 下一页