Rate This Document
Findability
Accuracy
Completeness
Readability

spring-cloud-gateway Error

Symptom

During compilation and installation, spring-cloud-gateway error occurs due to poor network of the compilation environment.

Key Process and Cause Analysis

The network is poor. Set timeout and the number of retry times to solve the problem.

Conclusion and Solution

  1. Modify the RetryGatewayFilterFactoryIntegrationTests.java file.
    vim spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java
  2. Increase the value of timeout and the number of retry times properly.
    • Modify line 68 to increase the value of spring.cloud.gateway.httpclient.response-timeout.
      • CentOS 7.6 or openEuler 20.03: 30s (recommended)
      • CentOS 8.1: 100s (recommended)
        "spring.cloud.gateway.httpclient.response-timeout=30s",
    • Add spring.cloud.spring.cloud.routes.filters.args.retries to line 69 and increase the number of retry times. The recommended value is 5.
      "spring.cloud.spring.cloud.routes.filters.args.retries=5" })

  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Run the compile command again.
    ./mvnw clean install -Dgpg.skip=true