聊聊spring cloud gateway的NettyConfiguration

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了聊聊spring cloud gateway的NettyConfiguration相关的知识,希望对你有一定的参考价值。

参考技术A 本文主要研究下spring cloud gateway的NettyConfiguration

spring-cloud-gateway-core-2.0.0.RC1-sources.jar!/org/springframework/cloud/gateway/config/HttpClientProperties.java

netty-handler-4.1.23.Final-sources.jar!/io/netty/handler/ssl/util/InsecureTrustManagerFactory.java

spring cloud gateway底层使用的是reactor的httpclient,可以通过spring.cloud.gateway.httpclient前缀的配置来指定相关options。主要分pool、proxy、ssl三大类。其中pool默认的type是elastic,如果是fixed的话,还可以指定maxConnections及acquireTimeout参数。

Spring Cloud(18)——gateway

Spring Cloud Gateway

Spring Cloud Gateway是Spring提供的API网关层,可以通过它代理请求,然后转发到真正的目标地址上。使用Spring Cloud Gateway需要加上spring-cloud-starter-gatewayspring-boot-starter-webflux依赖。

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-gateway

以上是关于聊聊spring cloud gateway的NettyConfiguration的主要内容,如果未能解决你的问题,请参考以下文章

Spring Cloud Gateway的断路器(CircuitBreaker)功能

Spring Cloud Gateway修改请求和响应body的内容

Spring Cloud Gateway修改请求和响应body的内容

spring cloud gateway 如何工作

spring cloud gateway 的执行流程

Spring Cloud Gateway集成