看到标题大家可能会有点疑惑吧:OpenFeign 不是挺好用的吗?尤其是微服务之间的远程调用,平时用的也挺习惯的,为啥要替换呢? 背景和原因是这样的: 部门/团队在安全性上有所考虑,即尽可能地减少/消除引入外部依赖,尽量只使用自研依赖、apache、Spring等必须的开源依赖; 而 OpenFeign 的使用则是引入了 Spring Cloud 依赖(不在安全要求范围内),所以需要考虑替换; 为以后团队的项目上 Spring 6做铺垫,Spring 6 会有 Spring 内置的 Http Interface 发起远程服务调用。 下面将从介绍 OpenFeign、常见的 Http API 以及重点介绍 Spring 自带的 RestTemplate Http 模板这3个方面展开。 OpenFeign 是 Spring Cloud 在 Feign 的基础上支持了 SpringMVC 的注解,如 @RequesMapping 等,其底层默认使用的是 URLConnection 实现。 OpenFeign 的 @FeignClient 注解可以解析 SpringMVC...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with HttpMethod
Contact HttpMethod, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack