Closed michaelwangwangwang closed 5 months ago
the version of the springboot and gateway are as follows:
springboot version:2.5.12 springCloud gateway:3.0.6
and the gateway configuration is as follows:
server:
port: 80
spring:
application:
name: spring-cloud-gateway
cloud:
loadbalancer:
cache:
enabled: true
retry:
enabled: true
retry-on-all-operations: true
max-retries-on-same-service-instance: 0
max-retries-on-next-service-instance: 3
gateway:
discovery:
locator:
enabled: true
lowerCaseServiceId: true
'predicates[0]':
name: Path
args:
patterns: '''/'' + serviceId + ''/**'''
'filters[0]':
name: RewritePath
args:
regexp: '''/'' + serviceId + ''/(?<remaining>.*)'''
replacement: '''/$\{remaining}'''
'filters[1]':
name: Retry
args:
retries: 3
exceptions:
'[0]': '''java.net.ConnectException'''
'[1]': '''java.io.IOException'''
statuses:
'[0]': '''BAD_GATEWAY'''
'[1]': '''SERVICE_UNAVAILABLE'''
series:
'[0]': '''CLIENT_ERROR'''
methods:
'[0]': '''GET'''
'[1]': '''POST'''
'[2]': '''PUT'''
'[3]': '''DELETE'''
backoff:
firstBackoff: '''100ms'''
maxBackoff: '''500ms'''
factor: 2
basedOnPreviousValue: false
'default-filters[0]':
name: RequestRateLimiter
args:
key-resolver: '#{@apiKeyResolver}'
redis-rate-limiter:
replenishRate: 500
burstCapacity: 800
requestedTokens: 1
httpclient:
connect-timeout: 500
ribbon:
OkToRetryOnAllOperations: true
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 3
Can someone answer me?
@spencergibb
@michaelwangwangwang Have you found any solution to your problem. I am having a similar problem with later versions of the Spring boot on windows 10/11 machines.
version 3.x is no longer supported. Is this still an issue in 4.1.x?
Also in your yaml replace
'[0]': '''java.net.ConnectException'''
with
- java.net.ConnectException
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
When a service instance suddenly goes down, the gateway sometimes has a 500 error, but the gateway itself has the function of automatic routing retry, I don’t know why the retry does not take effect sometimes。
the error is as follows: