Closed GJL closed 7 years ago
I believe the you are right the only way to do this is to subclass SimpleHostRoutingFilter
. Feel free to provide a PR with a better solution. Or we could try and address this issue along with fixing the issue in #1684.
@ryanjbaxter SimpleHostRoutingFilter
is not conditional in ZuulProxyConfiguration
. Even if it's subclassed, how'd I replace the existing one without doing bean post processing? Do I set SimpleHostRoutingFilter.route.disable = true
?
@GJL There is no property called TTL in the PoolingHttpClientConnectionManager
. What methods would you call to get the behavior you're asking for?
Use @Primary
@ryanjbaxter This doesn't apply to SimpleHostRoutingFilter
?
http://cloud.spring.io/spring-cloud-static/Dalston.RELEASE/#_disable_zuul_filters
You can try that as well, I haven't tried it myself. I dont see why it wouldnt work
Hey there, I have the same problem like @GJL . Is there any updates or improvements?
Hi all,
I am using zuul to route requests to statically configured services according to the request path. The services behind zuul are addressed using DNS names. The DNS records can change rather frequently (e.g., daily).
I have seen in
SimpleHostRoutingFilter
that zuul usesPoolingHttpClientConnectionManager
from Apache HttpComponents without configuring the time to live for the connections in the pool (see https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/SimpleHostRoutingFilter.java#L238). Even if the DNS records change, the connection pool in zuul is keeping the connections to the old instances open. Depending on the load, it can take many hours until all the old connections are evicted from the connection pool.I could subclass
SimpleHostRoutingFilter
and override the methodnewConnectionManager()
to return my own instance ofPoolingHttpClientConnectionManager
with a configured TTL. Is there any other way to solve my problem, and does it make sense to add this feature to zuul?Best, Gary