Closed Johnny-ZTSD closed 5 days ago
Q1. The spring.cloud.gateway.httpclient
component is responsible for handling outgoing HTTP requests from the gateway to other services. It provides a customizable HTTP client implementation that allows you to configure things like connection timeouts, maximum connections per route, and SSL settings. This component is used when the gateway is acting as a client to other services.
The 'spring.cloud.gateway.httpserver' component, on the other hand, is responsible for handling incoming HTTP requests from clients and routing them to the appropriate backend services. It provides a customizable HTTP server implementation that allows you to configure things like server ports, SSL settings, and request/response filters. This component is used when the gateway is acting as a server to clients.
In summary, the 'spring.cloud.gateway.httpclient' component is used for making outgoing requests, while the 'spring.cloud.gateway.httpserver' component is used for handling incoming requests.
Q2. To configure the connection timeout for 'spring.cloud.gateway.httpclient', you can set the property 'spring.cloud.gateway.httpclient.connect-timeout' to the desired value in milliseconds.
Q3. As explained in Q2 you can try this option or try to use the next example if you want to custom connection timeout per route:
- id: per_route_timeouts
uri: https://example.org
predicates:
- name: Path
args:
pattern: /delay/{timeout}
metadata:
response-timeout: 200
connect-timeout: 200
I hope my answer will be helpful. @Johnny-ZTSD
Closing due to age of the question. If you would like us to look at this issue, please comment and we will look at re-opening the issue.
Q1 What is the meaning and difference between
spring. cloud. gateway.httpclient
andspring. cloud. gateway.httpserver
?andspring. cloud. gateway.httpclient.pool
andspring. cloud. gateway.httpserver
?Q2 Based on Q1's question and the following call relationship, what is the HTTP connection configuration (such as connection Timeout) for the corresponding SCG? How to explain it?
Q3 Based on Q2, how should the timeout duration be configured for SCG gateway external calls to SCG?
Thanks~