Spring Cloud
Spring Cloud组件
liTianQi.
面向监.狱编程
展开
-
openfeign 远程调用接口 报错PathVariable annotation was empty on param 0.
今天在使用openfeign远程调用其他微服务接口的时候,报了一个错,导致项目无法正常启动。我查看了自建的openfeign接口中的代码,发现没有问题错误代码直接蒙了 难道老天爷今天想让我加班 我还等着回家躺平呢一顿瞎操作后 还是感觉很奇怪。。。。。。。一般来说@PathVariable 如果是一个参数的话,我都习惯性不写注解的参数,默认就可以用但是openfeign调用的接口,@PathVariable注解还必须写上值,绑定name正确代码再次启动服务就可以正常运行了~~~~..原创 2021-09-16 17:47:03 · 534 阅读 · 0 评论 -
feign -- Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t)
将feign 配置中compression.request.enabled 与 compression.response.enabled 改为false(关闭压缩) 问题可以解决# feign 配置feign: sentinel: enabled: true okhttp: enabled: true httpclient: enabled: false client: config: default: connectTim原创 2021-04-22 15:45:46 · 4205 阅读 · 2 评论 -
项目中添加Auth2后 访问接口报cors跨域问题
项目中添加Auth2后 访问接口报cors跨域问题在代码中增加CORSFilter配置类import org.springframework.context.annotation.Configuration;import org.springframework.core.Ordered;import org.springframework.core.annotation.Order;import javax.servlet.*;import javax.servlet.http.HttpSer转载 2021-03-15 10:41:52 · 285 阅读 · 0 评论 -
OpenFeign远程调用Request method ‘POST‘ not supported问题
解决方法:<!-- 在 pom 中添加依賴--> <dependency> <groupId>io.github.openfeign</groupId> <artifactId>feign-httpclient</artifactId> </dependency>原创 2020-10-28 17:02:21 · 1197 阅读 · 0 评论 -
Spring Cloud Gateway Predicate工厂配置(入门必看)
本文内容参考官方文档:Spring Cloud Gateway官方 -------如有问题,恳请指点!Spring Cloud Gateway介绍:网关作为流量的入口,常用的功能包括路由转发,权限校验,限流控制,Spring Cloud Gateway作为Spring Cloud官方提出的第二网关框架,取代了zuul网关。基本工作流程(白话): 请求发送给网关→断言匹配(Predicate)→(符合→经过n个过滤器到达指定地方)|| (不符合)基本工作流程(图-官方):Spring Clo.原创 2020-07-09 16:40:18 · 679 阅读 · 1 评论