Live My Life

淡而无味也是一种味道

Hexo-Theme-LiveMyLife

A succinct hexo theme...

Ported Theme of Hux Blog, Thank Huxpro for designing such a flawless theme. This LiveMyLife theme created by Vincent modified from the original Porter YenYuHsuan , refer to the Themes of dusign、Ut......

[JDK8] 6 Lambda 表达式练习

Practice something...

先来写个基本类 1234567891011121314151617181920212223242526public class LambdaTest { @Data class Student { private Integer id; private String name; private Integer age;......

[Reflect] 3 反射相关练习

反射相关练习

先来写几个基本类: 12345678/** * @author vincent */@Datapublic class FatherClass { public String fatherName; public int fatherAge;} 12345678910111213/** * @author vincent */@Datapublic clas......

[Spring Cloud Netflix] Spring Cloud 总结

Spring Cloud 基础什么是 Spring Cloud?Spring Cloud 是一系列框架的有序集合。它利用 Spring Boot 的开发便利性巧妙地简化了分布式系统基础设施的开发,如 服务发现注册、配置中心、智能路由、消息总线、负载均衡、断路器、数据监控 等,都可以用 Spring Boot 的开发风格做到一键启动和部署。Spring Cloud 并没有重复制造轮子,它只是......

[Calling Third-party API - OpenFeign] 5 Feign Spring Cloud upload、download File

Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to HTTP APIs regardless of ReSTfulness...

前言上文中讲到了 Feign 结合 SpringBoot 注解的具体用法以及 CircuitBreaker Fallbacks 的用法。具体可阅览 Feign Spring Cloud CircuitBreaker Fallbacks。今天博主要总结的是如何运用 Spring Cloud Feign 来实现文件上传下载功能。还是老规矩直接上案例代码。 Serveerpom.xml 和 Com......

[Calling Third-party API - OpenFeign] 4 Feign Spring Cloud CircuitBreaker Fallbacks

Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to HTTP APIs regardless of ReSTfulness...

前言 Feign makes writing java http clients easier :主要讲述了 Feign 的基本用法。 DefaultFeignClient Case and Summary:主要举例 Feign 原生注解调用第三方服务、Feign 结合 SpringMvc 注解调用第三方服务,并且简要封装了一个创建 Feign 构造器的工具类。 Feign Call Cas......

[Calling Third-party API - OpenFeign] 3 Feign Call Case

Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to HTTP APIs regardless of ReSTfulness...

上文博主已经举例并总结了 Feign 的大部分用法。那么接下来,博主结合实际真正开发中的情况,简单模拟了一个案例。需求大致如下:A 公司需要对接并获取 B 公司的用户信息和部门信息。在这里可以把 A 公司看做是调用方,B 公司是被调用方。或者说 A 公司是客户端,B 公司是服务端。那么直接上代码。 ServerCommonsResponseDto12345678910111213141516......

[IO] 5 How to Download a File from a URL in Java

There are multiple ways to download a file using Java code...

Are you looking to create your very own dataset for a new and innovative application? Or maybe you’re trying to collect data for analysis for a college project and have become weary of manually dow......
IO

[Calling Third-party API - OpenFeign] 2 DefaultFeignClient Case and Summary

Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to HTTP APIs regardless of ReSTfulness...

Summary根据 GitHub OpenFeign 官方文档,博主在这里对 Feign.builder() 模式进行了简要的封装。 同时对 Feign.builder() 配置协约 .contract(Contract contract) 做了进一步的说明和举例。contract 我暂时把它翻译为协约,这个属性在构造 Feign 对象实例时,用于定义 Feign 对象实例与之配合使用的注解......

[Spring Profile] How to Use Spring Profile

Profiles are a core feature of the framework — allowing us to map our beans to different profiles — for example, dev, test, and prod....

简介Profile 的意思是配置,对于应用程序来说,不同的环境需要不同的配置。比如: 开发环境,应用需要连接一个可供调试的数据库单机进程 生产环境,应用需要使用正式发布的数据库,通常是高可用的集群 测试环境,应用只需要使用内存式的模拟数据库 Spring 框架提供了多 profile 的管理功能,我们可以使用 profile 功能来区分不同环境的配置。 区分 Bean 对象首先,我们先看......