上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 95 下一页
摘要: 定时任务应用非常广泛,Java提供的现有解决方案有很多。本次主要讲schedule、quartz、xxl-job、shedlock等相关的代码实践。 一、SpringBoot使用Schedule 核心代码: @Component public class ScheduleTask { private 阅读全文
posted @ 2020-11-22 13:18 挑战者V 阅读(791) 评论(0) 推荐(0) 编辑
摘要: 前面我在下面这篇文章说过如何使用WebService:SpringBoot整合Apache-CXF实践 在这篇文章中我列举过通过SOAP UI测试webservice接口。 但实际中涉及服务调用的情况,需要类似单元测试的东西。 一、基于代理类工厂 核心代码很简单,如下所示(这个比较普遍常用): tr 阅读全文
posted @ 2020-11-21 14:49 挑战者V 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 总结项目里使用Java8新特性对List的数据处理(用的比较多的)。 一、分组 Map<String, List<T>> yearData = allData.stream().collect(Collectors.groupingBy(T::getYear)); 二、条件筛选 单条件筛选 List 阅读全文
posted @ 2020-11-21 14:47 挑战者V 阅读(1007) 评论(0) 推荐(0) 编辑
摘要: 核心代码(下载网络图片到本地文件夹): public class DownFileUtils { public static void downloadFile(String remoteFilePath, String localFilePath) { URL urlfile = null; Ht 阅读全文
posted @ 2020-11-21 14:46 挑战者V 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 最早接触Hutool这个集常用工具类为一体的框架工具包是在2018年的时候(酒店业务需要调用第三方门锁API)。而后19年因为业务接触到Bmob云,开始写对Bmob云的API,于是便有了这篇文章Hutool工具类之HttpUtil使用Https 最近针对业务,再次用到这个。这次涉及到不同单个服务之间 阅读全文
posted @ 2020-11-21 14:45 挑战者V 阅读(18675) 评论(0) 推荐(0) 编辑
摘要: 一、Sentinel Sentinel GitHub地址:https://github.com/alibaba/Sentinel 关于Sentinel详细介绍:https://github.com/alibaba/Sentinel/wiki/%E4%BB%8B%E7%BB%8D Sentinel官方 阅读全文
posted @ 2020-11-07 17:05 挑战者V 阅读(945) 评论(0) 推荐(0) 编辑
摘要: 一、为什么选择SpringCloud Gateway而不是Zuul? Gateway和Zuul的职责一样,都承担着请求分发,类似Nginx分发到后端服务器。 1.SpingCloud Gateway 和SpringCloud Zuul对比分析 (1)相同点 底层都是servlet 两者均是web网关 阅读全文
posted @ 2020-11-07 17:02 挑战者V 阅读(668) 评论(0) 推荐(0) 编辑
摘要: 1.错误信息 com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server 2.错误背景 启动Eureka Server报错 3.错误原因 Spring2.0 阅读全文
posted @ 2020-11-07 17:00 挑战者V 阅读(843) 评论(0) 推荐(0) 编辑
摘要: 一、为什么要有分布式链路追踪 链路追踪的主要目的在于让我们知道A微服务调用B微服务,B微服务调用C微服务,C微服务调用D微服务,D微服务调用A微服务等整个流程是怎样的。 二、SpringCloud整合Sleuth+Zipkin 1.Maven依赖 <!-- SpringCloud Sleuth -- 阅读全文
posted @ 2020-11-06 23:25 挑战者V 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 最近在试验某个功能遇到这样的需求,并不需要项目一直运行,这是在某个特定的时候运行即可,而且只运行main方法里面的应用程序。这里我没有用grandle,用的是Maven,主要在pom.xml配置如下内容即可: <build> <plugins> <plugin> <groupId>org.apach 阅读全文
posted @ 2020-11-06 23:23 挑战者V 阅读(1035) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 95 下一页