【转载】Spring Cloud Gateway排错、调试技巧总结
http://www.imooc.com/article/290824
本文总结Spring Cloud Gateway的排错、调试技巧。欢迎留言补充!
第一式:Actuator监控端点
借助Actuator的监控端点,可分析全局过滤器、过滤器工厂、路由详情。详见:Spring Cloud Gateway监控
第二式:日志
加日志,按需将如下包的日志级别设置成 debug 或 trace ,总有一款对你有用。
org.springframework.cloud.gatewayorg.springframework.http.server.reactiveorg.springframework.web.reactiveorg.springframework.boot.autoconfigure.webreactor.nettyredisratelimiter
配置示例:
logging:
level:
org.springframework.cloud.gateway: trace
第三式:Wiretap【从Greenwich SR3及更高版本才会支持】
Reactor Netty HttpClient 以及 HttpServer 可启用 Wiretap 。将reactor.netty 包设置成 debug 或 trace ,然后设置如下属性:
spring.cloud.gateway.httpserver.wiretap=truespring.cloud.gateway.httpclient.wiretap=true
分别开启HttpServer及HttpClient的Wiretap。
然后,就可以分析日志啦。
TIPS
- 相关Issue: https://github.com/spring-cloud/spring-cloud-gateway/issues/1194
- wiretap其实是Reactor Netty的概念,作用是,打印对端之间的流量详情,相关文档:
本文首发
【转载】Spring Cloud Gateway排错、调试技巧总结的更多相关文章
- 纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比 (转载)
纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比 Spring Cloud Spring Cloud Spring Cloud Gatew ...
- 从0开始构建你的api网关--Spring Cloud Gateway网关实战及原理解析
API 网关 API 网关出现的原因是微服务架构的出现,不同的微服务一般会有不同的网络地址,而外部客户端可能需要调用多个服务的接口才能完成一个业务需求,如果让客户端直接与各个微服务通信,会有以下的问题 ...
- Spring Cloud Gateway中异常处理
最近我们的项目在考虑使用Gateway,考虑使用Spring Cloud Gateway,发现网关的异常处理和spring boot 单体应用异常处理还是有很大区别的.让我们来回顾一下异常. 关于异常 ...
- spring cloud gateway之filter篇
转载请标明出处: https://www.fangzhipeng.com 本文出自方志朋的博客 在上一篇文章详细的介绍了Gateway的Predict,Predict决定了请求由哪一个路由处理,在路由 ...
- 网关服务Spring Cloud Gateway(二)
上一篇文章服务网关 Spring Cloud GateWay 初级篇,介绍了 Spring Cloud Gateway 的相关术语.技术原理,以及如何快速使用 Spring Cloud Gateway ...
- spring cloud gateway 之限流篇
转载请标明出处: https://www.fangzhipeng.com 本文出自方志朋的博客 在高并发的系统中,往往需要在系统中做限流,一方面是为了防止大量的请求使服务器过载,导致服务不可用,另一方 ...
- Spring Cloud Gateway VS Zuul 比较,怎么选择?
Spring Cloud Gateway 是 Spring Cloud Finchley 版推出来的新组件,用来代替服务网关:Zuul. 那 Spring Cloud Gateway 和 Zuul 都 ...
- 微服务网关实战——Spring Cloud Gateway
导读 作为Netflix Zuul的替代者,Spring Cloud Gateway是一款非常实用的微服务网关,在Spring Cloud微服务架构体系中发挥非常大的作用.本文对Spring Clou ...
- 跟我学SpringCloud | 第十三篇:Spring Cloud Gateway服务化和过滤器
SpringCloud系列教程 | 第十三篇:Spring Cloud Gateway服务化和过滤器 Springboot: 2.1.6.RELEASE SpringCloud: Greenwich. ...
- Spring Cloud gateway 网关服务 一
之前我们介绍了 zuul网关服务,今天聊聊spring cloud gateway 作为spring cloud的亲儿子网关服务.很多的想法都是参照zuul,为了考虑zuul 迁移到gateway 提 ...
随机推荐
- 前端工程化解决方案webpack使用小结
前端工程化解决方案webpack,模块化.组件化.规范化.自动化,使得前端开发更加高效. 功能:代码压缩混淆.处理浏览器端js的兼容性.以模块化的方式处理项目中的资源 webpack插件:clean- ...
- DOMException: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'function (header, parser) { header = normalizeHeader(header);
场景:token过期,然后更新了token 重新发起请求获取数据 : 代码:使用上一次的错误请求配置报错 return request(error.config) : 解决 : return ...
- 00 通过 Pytorch 实现 Transformer 框架完整代码
博客配套视频链接: https://space.bilibili.com/383551518?spm_id_from=333.1007.0.0 b 站直接看 配套 github 链接:https:// ...
- Java高并发synchronized讲解生产者消费者
问题描述 题目:两个线程操作一个变量,实现两个线程对同一个资源一个进行加1操作,另外一个进行减1操作,且需要交替实现,变量的初始值为0.即两个线程对同一个资源进行加一减一交替操作.话不多说,开干首先我 ...
- NDT算法(深蓝学院)
- [Go] 如何妥善处理 TCP 代理中连接的关闭
如何妥善处理 TCP 代理中连接的关闭 相比较于直接关闭 TCP 连接,只关闭 TCP 连接读写使用单工连接的场景较少,但通用的 TCP 代理也需要考虑这部分场景. 背景 今天在看老代码的时候,发现一 ...
- Java后端请求想接收多个对象入参的数据方法
在Java后端开发中,如果我们希望接收多个对象作为HTTP请求的入参,可以使用Spring Boot框架来简化这一过程.Spring Boot提供了强大的RESTful API支持,能够方便地处理各种 ...
- 内网IP地址实现HTTPS加密访问教程
一.前期准备 确定内网IP地址: 确保有一个明确且固定的内网IP地址.动态IP地址可能不适合此场景,因为它们会频繁改变,导致SSL证书失效. 选择SSL证书颁发机构(CA): 选择一个受信任的CA,如 ...
- 移动端自动化之uiautomator2
github: https://github.com/openatx/uiautomator2 [安装] pip3 install -U uiautomator2# 安装UI Inspector -- ...
- golang之errors包
errors包常用方法 func Unwrap(err error) error // 获得err包含下一层错误 func Is(err, target error) bool // 判断err是否包 ...