![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
龙行九天之上
日常开发记录, 无特别整理
展开
-
spring boot 配置文件中 时间参数解析到Duration
配置解析按照spring-boot核心包org.springframework.boot.convert中的StringToDurationConverter按照约定的格式进行解析。最后由转换器转换为 对应的Duration对象,而非直接调用Duration中的parse方法进行转换。原创 2022-08-10 17:49:59 · 1506 阅读 · 0 评论 -
spring cloud zone 参数设置
通过 eureka.client.availability-zones 设置, key 为设置的region参数, value为设置的zone参数可通过 InstanceInfo类获取该参数确认方式, 如下: /** * Get the zone that a particular instance is in. * Note that for AWS deployments, myInfo should contain AWS dataCenterInfo whic原创 2021-06-23 19:08:55 · 237 阅读 · 0 评论 -
thread 内 事务失效
进行批量数据更新的时候, 为了接口主线程的直接返回避免http超时, 新构建Thread进行数据的更新.为了避免更新中出现问题导致最终的数据库不一致, 添加了事务.由于在一个类内操作, 于是添加了@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) 注解, 同时在调用的时候, 使用 AopContext.currentProxy() 获取当前的代理类, 测试报错如下:Cannot find curre.原创 2020-05-18 21:20:10 · 608 阅读 · 0 评论