http://www.imooc.com/article/290824

本文总结Spring Cloud Gateway的排错、调试技巧。欢迎留言补充!

第一式:Actuator监控端点

借助Actuator的监控端点,可分析全局过滤器、过滤器工厂、路由详情。详见:Spring Cloud Gateway监控

第二式:日志

加日志,按需将如下包的日志级别设置成 debug 或 trace ,总有一款对你有用。

  • org.springframework.cloud.gateway
  • org.springframework.http.server.reactive
  • org.springframework.web.reactive
  • org.springframework.boot.autoconfigure.web
  • reactor.netty
  • redisratelimiter

配置示例:

logging:
level:
org.springframework.cloud.gateway: trace

第三式:Wiretap【从Greenwich SR3及更高版本才会支持】

Reactor Netty HttpClient 以及 HttpServer 可启用 Wiretap 。将reactor.netty 包设置成 debug 或 trace ,然后设置如下属性:

  • spring.cloud.gateway.httpserver.wiretap=true
  • spring.cloud.gateway.httpclient.wiretap=true

分别开启HttpServer及HttpClient的Wiretap。

然后,就可以分析日志啦。

TIPS

本文首发

 
 

【转载】Spring Cloud Gateway排错、调试技巧总结的更多相关文章

  1. 纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比 (转载)

    纠错帖:Zuul & Spring Cloud Gateway & Linkerd性能对比  Spring Cloud  Spring Cloud Spring Cloud Gatew ...

  2. 从0开始构建你的api网关--Spring Cloud Gateway网关实战及原理解析

    API 网关 API 网关出现的原因是微服务架构的出现,不同的微服务一般会有不同的网络地址,而外部客户端可能需要调用多个服务的接口才能完成一个业务需求,如果让客户端直接与各个微服务通信,会有以下的问题 ...

  3. Spring Cloud Gateway中异常处理

    最近我们的项目在考虑使用Gateway,考虑使用Spring Cloud Gateway,发现网关的异常处理和spring boot 单体应用异常处理还是有很大区别的.让我们来回顾一下异常. 关于异常 ...

  4. spring cloud gateway之filter篇

    转载请标明出处: https://www.fangzhipeng.com 本文出自方志朋的博客 在上一篇文章详细的介绍了Gateway的Predict,Predict决定了请求由哪一个路由处理,在路由 ...

  5. 网关服务Spring Cloud Gateway(二)

    上一篇文章服务网关 Spring Cloud GateWay 初级篇,介绍了 Spring Cloud Gateway 的相关术语.技术原理,以及如何快速使用 Spring Cloud Gateway ...

  6. spring cloud gateway 之限流篇

    转载请标明出处: https://www.fangzhipeng.com 本文出自方志朋的博客 在高并发的系统中,往往需要在系统中做限流,一方面是为了防止大量的请求使服务器过载,导致服务不可用,另一方 ...

  7. Spring Cloud Gateway VS Zuul 比较,怎么选择?

    Spring Cloud Gateway 是 Spring Cloud Finchley 版推出来的新组件,用来代替服务网关:Zuul. 那 Spring Cloud Gateway 和 Zuul 都 ...

  8. 微服务网关实战——Spring Cloud Gateway

    导读 作为Netflix Zuul的替代者,Spring Cloud Gateway是一款非常实用的微服务网关,在Spring Cloud微服务架构体系中发挥非常大的作用.本文对Spring Clou ...

  9. 跟我学SpringCloud | 第十三篇:Spring Cloud Gateway服务化和过滤器

    SpringCloud系列教程 | 第十三篇:Spring Cloud Gateway服务化和过滤器 Springboot: 2.1.6.RELEASE SpringCloud: Greenwich. ...

  10. Spring Cloud gateway 网关服务 一

    之前我们介绍了 zuul网关服务,今天聊聊spring cloud gateway 作为spring cloud的亲儿子网关服务.很多的想法都是参照zuul,为了考虑zuul 迁移到gateway 提 ...

随机推荐

  1. C#的类和对象,继承

    /// 类与对象 /// 类和对象是面向编程的两个核心概念 /// 类:类是对一群具有相同特征的或者行为事物的统称 类 是图纸 /// 对象是由类创造出来的一个具体存在 可以直接使用 对象是图纸造出来 ...

  2. 双指针习题:Kalindrome Array

    Kalindrome Array 题目链接: Kalindrome Array - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题面翻译 对于长度为 \(m\) 的序列 \(b\), ...

  3. 云原生爱好者周刊:使用树莓派组建 K8s 集群 | 2022-08-08

    开源项目推荐 Raspberry Pi Kubernetes Cluster 这是一个教育项目,旨在探索如何在家中使用树莓派构建 Kubernetes 集群,并使用 Ansible 来自动化部署和配置 ...

  4. HTML标签 b 和 strong 的区别

    <b>标签和<strong>标签都表示加粗,效果通常是一样的: <b>:义演丁真<strong>:义演丁真 类似的还有<em>和<i& ...

  5. NES 系统架构

    主机 NES(FC.红白机.小霸王)的系统架构可用下图表示: 系统中最核心的组件是 CPU,其它组件都可以算作 CPU 的外设.CPU 的外设包括:PPU(图像处理器).APU(音频处理器).WRAM ...

  6. OAS常见错误

    body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px } h1, h2 { color: rgba(51, 51, ...

  7. Python比较2个json数据是否相等

    1.json数据转换成字典 dict1 = json.load(load_f1) dict2 = json.load(load_f2) 2.将两个字典按key排好序,然后使用zip()函数将两个字典对 ...

  8. C++入门级基础知识汇总

    知识来源:https://www.imooc.com/learn/1304 https://www.runoob.com/cplusplus/cpp-tutorial.html 编程第一步导入头文件: ...

  9. windows当中C++版本的Opencv安装(动态库+静态库)

    主要参考2篇博客,其实就是dll文件和lib文件的使用方法而已.链接如下: 1.静态库opencv配置 2.动态库opencv安装

  10. 题解:CF685A Robbers' watch

    题解:CF685A Robbers' watch 感觉这题难点主要在理解题意. 题意 一天 \(n\) 个小时,一小时 \(m\) 分钟,手表用 \(7\) 进制表示时间(位数未填满补前导零),求问这 ...