一、debug的调用栈如下:
DispatcherHandler.handle(ServerWebExchange) line: 149
DefaultWebFilterChain.lambda$filter$0(ServerWebExchange) line: 79
1774625216.get() line: not available
MonoDefer<T>.subscribe(CoreSubscriber<? super T>) line: 45
MonoPeekTerminal<T>.subscribe(CoreSubscriber<? super T>) line: 61
MonoFlatMap$FlatMapMain<T,R>.onNext(T) line: 150
MonoZip$ZipCoordinator<R>(Operators$MonoSubscriber<I,O>).complete(O) line: 1083
MonoZip$ZipCoordinator<R>.signal() line: 247
MonoZip$ZipInner<R>.onNext(Object) line: 329
Operators$ScalarSubscription<T>.request(long) line: 1640
MonoZip$ZipInner<R>.onSubscribe(Subscription) line: 318
MonoJust<T>.subscribe(CoreSubscriber<? super T>) line: 54
MonoJust<T>(Mono<T>).subscribe(Subscriber<? super T>) line: 3080
MonoZip<T,R>.subscribe(CoreSubscriber<? super R>) line: 128
MonoFlatMap<T,R>.subscribe(CoreSubscriber<? super R>) line: 60
MonoDefer<T>.subscribe(CoreSubscriber<? super T>) line: 53
MonoDefer<T>.subscribe(CoreSubscriber<? super T>) line: 53
MonoPeekTerminal<T>.subscribe(CoreSubscriber<? super T>) line: 61
MonoPeekFuseable<T>.subscribe(CoreSubscriber<? super T>) line: 74
MonoDefer<T>.subscribe(CoreSubscriber<? super T>) line: 53
MonoDefer<T>.subscribe(CoreSubscriber<? super T>) line: 53
MonoOnErrorResume<T>.subscribe(CoreSubscriber<? super T>) line: 44
MonoOnErrorResume<T>.subscribe(CoreSubscriber<? super T>) line: 44
MonoOnErrorResume<T>.subscribe(CoreSubscriber<? super T>) line: 44
MonoOnErrorResume<T>(Mono<T>).subscribe(Subscriber<? super T>) line: 3080
MonoIgnoreThen$ThenIgnoreMain<T>.drain() line: 172
MonoIgnoreThen<T>.subscribe(CoreSubscriber<? super T>) line: 56
MonoPeekFuseable<T>.subscribe(CoreSubscriber<? super T>) line: 70
MonoPeekTerminal<T>.subscribe(CoreSubscriber<? super T>) line: 61
HttpServerOperations(ChannelOperations<INBOUND,OUTBOUND>).applyHandler() line: 380
HttpServerOperations.onHandlerStart() line: 398
522293148.run() line: not available
AbstractEventExecutor.safeExecute(Runnable) line: 163
NioEventLoop(SingleThreadEventExecutor).runAllTasks(long) line: 404
NioEventLoop.run() line: 465
SingleThreadEventExecutor$5.run() line: 884
DefaultLoopResources$EventLoop(Thread).run() line: not available
二、说明:从下到上依次是
1、netty的主事件循环
2、reactive接管网络事件的消息处理 HttpServerHandler extends ChannelDuplexHandler
3、通过reactive 内部的异步mono封装 HttpServerOperations把流程代理给spring的webflux
4、webflux 通过 org.springframework.web.server.handler.DefaultWebFilterChain 回调DispatcherHandler
三、几个jar包之间的关系
1、reactor-netty reactor对netty的封装
2、
reactor-core 核心flux和mono的封装
reactor-extra 数学、cache等的扩展
reactive-stream
3、spring-web 统一对http的基本数据结构和HttpHandler进行抽象
4、spring-webflux 基于reactor,用DispatcherHandler来映射请求到method
tips: @FunctionalInterface可以使用lambda表达式创建自定义的接口
相关推荐
Spring Cloud Gateway的全局异常处理 Spring Cloud Gateway中的全局异常处理不能直接用@ControllerAdvice来处理,通过跟踪异常信息的抛出,找到对应的源码,自定义一些处理逻辑来符合业务的需求。 网关都是给接口做...
springcloud gateway 全局滤器 统一签名判定
1.本项目为SpringCloud Gateway的微服务框架,整合了SpringSecurity,微服务间使用Redis来获取登陆的用户信息。 2.由于Gat
目前相关的教程虽然有很多,但总觉得被各位大佬压缩,看到的只是一部分知识,并不全面,因此作者根据Spring Cloud Gateway 官方参考指南写下了这篇中文版文字教程,并且录制了一些视频教程,希望更有助于您理解。
这个项目提供了一个构建在 Spring 生态系统之上的 API 网关,包括:Spring 5,Spring ... Spring Cloud Gateway 旨在提供一种简单而有效的 API 路 由方式,并为其提供横切关注点,例如:安全,监控/指标和弹性。
Maven构建,Spring Cloud Eureka + Spring Cloud Gateway + Spring Cloud Zipkin案例,含有SpringCloud中文文档
在接入Spring-Cloud-Gateway时,可能有需求进行缓存Json-Body数据或者Form-Urlencoded数据的情况。这篇文章主要介绍了SpringCloud Finchley Gateway 缓存请求Body和Form表单的实现,感兴趣的小伙伴们可以参考一下
spring cloud gateway 例子,文7章https://my.oschina.net/penngo/blog/5410254附件
Spring官方博客发布了一篇关于Spring Cloud Gateway的CVE报告,据公告描述,当启用和暴露 Gateway Actuator 端点时,使用 Spring Cloud Gateway 的应用程序可受到代码注入攻击。攻击者可以发送特制的恶意请求,从而...
websocket,springcloud
Spring Cloud Gateway模块
spring cloud
网关里包括一个简单aop代理,使用简单路由及默认过滤器,还有5个一样的修改request body的自定义全局过滤器。
Spring Cloud Gateway是Spring官方基于Spring 5.0,Spring Boot 2.0和Project Reactor等技术开发的网关,Spring Cloud Gateway旨在为微服务架构提供一种简单而有效的统一的API路由管理方式。Spring Cloud Gateway...
Spring cloud alibaba nacos与spring cloud gateway结合demo,项目注册,网关服务。
spring cloud gateway是一个spring提供的用于构建网关的子项目,文档内容主要是实现网关跨域。
spring cloud gateway的负载均衡和动态路由的实现 demo_01,demo_02,demo_03 这三个服务相当于是集群的微服务 gateway这个服务是 springcloude gateway + ribbon 做的负载均衡 gateway_01 这个服务 是动态路由的...
赠送jar包:spring-cloud-gateway-server-3.1.1.jar; 赠送原API文档:spring-cloud-gateway-server-3.1.1-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.1.1-sources.jar; 赠送Maven依赖信息文件:...
适用最新的spring cloud稳定版,微服务注册中心适用最新稳定版zookeeper。适用spring cloud gateway作为网关服务的demo
赠送jar包:spring-cloud-gateway-server-3.1.1.jar; 赠送原API文档:spring-cloud-gateway-server-3.1.1-javadoc.jar; 赠送源代码:spring-cloud-gateway-server-3.1.1-sources.jar; 赠送Maven依赖信息文件:...