spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.51k stars 3.31k forks source link

Spring cloud gateway sometime miss response #2621

Closed vietbrother closed 6 months ago

vietbrother commented 2 years ago

Dear team, I used spring-cloud-gateway with gs-guide https://github.com/spring-guides/gs-gateway/tree/main/complete on version spring boot 2.6.6 . I built service on docker and deploy it on k8s with flow : Client -> Gateway (k8s) (1 container) -> MicroService (k8s) (2 container)

Describe the bug

Almost time it is okay, but sometime gateway missing response from microservice. Detail 1 case by time in log file:

Because business, microservice take about 2s to 15s. Total number request is small (about 100-200rq/day) and gateway only use for this service

My configuration

-Dreactor.netty.http.server.accessLogEnabled=true
reactor.netty.http.server.accessLogEnabled=true
server.port=9999
spring.application.name = XpressGSGateway
############## HEALTH CHECK #############################################
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=ALWAYS
management.endpoints.web.base-path=/monitor
management.endpoints.web.path-mapping.health=healthcheck
info.app.name=GS GATEWAY
info.app.description=GS GATEWAY
info.app.version=1.0.0
spring.cloud.gateway.routes[0].id=xes_api_rpa
spring.cloud.gateway.routes[0].uri=http://localhost:8127
spring.cloud.gateway.routes[0].predicates[0]=Path=/api/rpa/acct/**
spring.cloud.gateway.routes[0].filters[0]=StripPrefix=3
############# LOG ##################################################
spring.cloud.config.enabled= false
logging.level.org.springframework=INFO
logging.level.org.springframework.cloud.gateway=INFO
logging.level.org.springframework.http.server.reactive=INFO
logging.level.org.springframework.web.reactive=INFO
logging.level.org.springframework.boot.autoconfigure.web=INFO
logging.level.reactor.netty=INFO
logging.level.org.springframework.cloud.sleuth=INFO
spring.cloud.gateway.httpclient.wiretap=true
spring.cloud.gateway.httpserver.wiretap=true
reactor.netty.http.server.accessLogEnabled=true

spring.codec.max-in-memory-size=5MB
spring.cloud.gateway.httpclient.connect-timeout=10000
spring.cloud.gateway.httpclient.response-timeout=40s
spencergibb commented 6 months ago

How could I replicate this?

spring-cloud-issues commented 6 months ago

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.

spring-cloud-issues commented 6 months ago

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.