10 2020 档案

摘要:一、消息队列 放到本地事务最后一步 发送消息写到最后边 一直重试,知道成功为止 把方法分开 先发送消息,后调用本地事务 消息(事务消息) 不可消费 本地成功后再把消息改成可消费消息 本地事务失败把消息删掉 2PC 两阶段提交 二、AT-业务无侵入模式 第二个事务提交前等待下wait 1、首先拿到事务 阅读全文
posted @ 2020-10-27 14:32 jentary 阅读(125) 评论(0) 推荐(0) 编辑
摘要:org.springframework.beans.BeanUtils BeanUtils org.apache.commons.beanutils.BeanUtils.copyProperties(targetDemo, sourceDemo); 阅读全文
posted @ 2020-10-21 11:19 jentary 阅读(65) 评论(0) 推荐(0) 编辑
摘要:private static final ThreadLocal<Boolean> threadLocal = ThreadLocal.withInitial(() -> Boolean.FALSE); 阅读全文
posted @ 2020-10-20 13:02 jentary 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-10-16 19:09 jentary 阅读(298) 评论(0) 推荐(0) 编辑
摘要:Executor executor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), Runtime.getRuntime().availableProcessors() * 2, 5L, TimeUnit.SE 阅读全文
posted @ 2020-10-07 14:46 jentary 阅读(95) 评论(0) 推荐(0) 编辑
摘要:用lambda表达式实现map 一提到函数式编程,一提到lambda表达式,怎么能不提map。。。没错,java8肯定也是支持的。请看示例代码: @Test public void mapTest() { List<Double> cost = Arrays.asList(10.0, 20.0,30 阅读全文
posted @ 2020-10-07 13:47 jentary 阅读(149) 评论(0) 推荐(0) 编辑