Spring cloud gateway 04 analyzes the source gateway filters

Filter Factory, is responsible for creating the corresponding filter

RouteToRequestUrlFilter: Get the route exchange from ginseng, the requestUrl splicing, and this property is set to the exchange of requestUrl

ReactiveLoadBalancerClientFilter: obtaining a service instance, and then parse the uri from the exchange, the splicing requestUrl, provided to the property

ForwardRoutingFilter: forward routing gateway filters. Based on  forward:// prefix (Scheme) filtering, the gateway forwards the request to the current instance of a local interface.

WebClientHttpRoutingFilter

    WebClientWriteResponseFilter, and WebClientHttpRoutingFilter  paired gateway filters. It will WebClientWriteResponseFilter Http request to the back-end services in response to write back to the client.

1. Obtain the property exchange properties requestUrl

2. If the route has been passed, request or not http, https, and the remainder of the filter directly operated filter

3. No route before, had set the route identifier

4. Get request from the exchange, and then obtaining httpMethod

5. The method according to requestBodySpec constructed and url, headers

6. Continue to build headersSpec

7. initiates a request for backend services, and acquisition response Response, the result status code configured

8. Continue other filters filter

    

 

Published 386 original articles · won praise 2 · Views 9837

Guess you like

Origin blog.csdn.net/kuaipao19950507/article/details/105277751