2021年7月19日

记一次insert on duplicate key update的使用

摘要: 基本需求描述:积分扣减/增加操作,记录每条积分明细的同时需要更新一下积分总数,积分不足扣减的时候需要返回异常提示信息。 初始方案: 1 @Modifying 2 @Query(value = "insert ignore into points_total(customer_id, phone_no 阅读全文

posted @ 2021-07-19 18:55 mylittlecabin 阅读(65) 评论(0) 推荐(0) 编辑

2021年7月12日

如何让kafka consumer从指定的位置开始消费

摘要: String topic = "test"; TopicPartition tp = new TopicPartition(topic, 0); try (KafkaConsumer<String, String> consumer = new KafkaConsumer<>(configs)) { 阅读全文

posted @ 2021-07-12 10:49 mylittlecabin 阅读(1388) 评论(0) 推荐(0) 编辑

2021年7月9日

奇怪设置了enable.auto.commit=false不生效?!

摘要: 测试手动消费kafka消息时,给kafka消费者设置了enable.auto.commit=false ,没有commit offset ,但每次消费获取的却是最新的offset数据?! properties.put("enable.auto.commit", "false"); 最后发现因为我在测 阅读全文

posted @ 2021-07-09 11:51 mylittlecabin 阅读(1042) 评论(0) 推荐(0) 编辑

2021年7月4日

spring boot访问不了本项目下的js文件

摘要: 访问不了js文件 http://localhost:8080/static/seckill.js application.properties文件或者application.yml配置文件增加 spring.mvc.static-path-pattern=/static/** 阅读全文

posted @ 2021-07-04 15:36 mylittlecabin 阅读(293) 评论(0) 推荐(0) 编辑

spring boot启动报错,no tcnative-1 in java.library.path, no libtcnative-1 in java.library.path

摘要: 根据日志中显示的tomcat版本,去官网下载tomcat,解压后将bin目录下tcnative-1.dll 放到 C:\Windows\System32 目录下即可; 本文springboot内嵌tomcat版本:9.0.46 阅读全文

posted @ 2021-07-04 14:09 mylittlecabin 阅读(2208) 评论(0) 推荐(0) 编辑

mybatis报错:Cause: java.io.FileNotFoundException: http://commons.apache.org/dtds/mbeans-descriptors.dtd

摘要: 解决: mybatis.mapper-locations=classpath*:**/mapper/*.xml修改为 mybatis.mapper-locations=classpath:**/mapper/*.xml参考:https://stackoverflow.com/questions/65 阅读全文

posted @ 2021-07-04 14:04 mylittlecabin 阅读(421) 评论(0) 推荐(0) 编辑

2021年6月25日

怎么让request inputstream 可以多次读取

摘要: 1、包装ServletRequest对象 public class IRequestWrapper extends HttpServletRequestWrapper { private byte[] body; public IRequestWrapper(HttpServletRequest r 阅读全文

posted @ 2021-06-25 16:00 mylittlecabin 阅读(227) 评论(0) 推荐(0) 编辑

2021年6月21日

win10下git bash console中文乱码

摘要: 右键选择“Options” 进入设置页面, 阅读全文

posted @ 2021-06-21 20:15 mylittlecabin 阅读(83) 评论(0) 推荐(0) 编辑

2021年6月16日

vs code 中markdown 文件使用MPE(Markdown preview enhanced)配合chrome打印没有背景怎么解决?

摘要: 问题:markdwon转pdf,chrome生成的pdf中代码块背景色不显示。 1、ctrl + shift + p 打开配置文件: 2、新增配置: "markdown-preview-enhanced.printBackground": true 阅读全文

posted @ 2021-06-16 20:17 mylittlecabin 阅读(358) 评论(0) 推荐(0) 编辑

2021年5月6日

如何查看当前spring boot应用的配置文件

摘要: @Autowired org.springframework.core.env.ConfigurableEnvironment environment; List<String> pss = StreamSupport.stream(environment.getPropertySources(). 阅读全文

posted @ 2021-05-06 10:02 mylittlecabin 阅读(1147) 评论(0) 推荐(0) 编辑

导航