![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
weixin_40241263
这个作者很懒,什么都没留下…
展开
-
Consider defining a bean of type ‘org.springframework.cloud.gateway.filter.factory.SpringCloudCircui
网上搜的大多是要要排除其他依赖的spring-boot-starter-web,因为会与spring cloud gateway的webflux冲突。但是我使用springcloud2021.0.0版本的gateway,即使项目中没有依赖spring-boot-starter-web依然会报这个错。 解决方法(参考官方文档)添加依赖: <dependency> <groupId>org.springframework.cloud</groupId>原创 2022-02-15 13:01:41 · 446 阅读 · 0 评论 -
1-100求和 递归+线程池
1-100求和 递归+线程池 public class Test { static int coreSize = Runtime.getRuntime().availableProcessors() + 1; static RecursiveThreadPoolExecutor executor = new RecursiveThreadPoolExecutor(coreSize, coreSize << 1, 60, TimeUnit.SECONDS, new原创 2021-08-13 13:43:01 · 78 阅读 · 0 评论 -
lockInterruptibly, lock, synchronized 的关于响应中断的区别
场景: 两个线程都需要执行同一个任务(Runnable),先让其中一个执行,拿到锁后睡五秒。紧接着 第二个线程开始执行,等第二个开始执行3秒后,打断(这是第二个线程肯定还未拿到锁) 表现: lockInterruptibly:thread2立即响应中断抛出异常 lock和synchronized: thread2一直尝试拿到锁后才响应中断 测试用例: lockInterruptily/ lock ...原创 2019-11-06 17:13:17 · 681 阅读 · 0 评论