These are chat archives for spring-cloud/spring-cloud

3rd
Mar 2016
David Welch
@dwelch2344
Mar 03 2016 17:33
Hey @spencergibb, working with Zuul + Feign + Consul and have a few proxied requests that timeout due to longer processing times. Seems like anything 2+ seconds will get killed w/ something along the lines of HystrixRuntimeException: usersRibbonCommand timed-out and no fallback available
I'm searching for a way to configure timeouts, which I'm guessing I could do if I annotated methods on feign, but since this endpoint is just proxied through Zuul I don't really have anything to annotate
Spencer Gibb
@spencergibb
Mar 03 2016 17:34
that exception is in the zuul logs?
David Welch
@dwelch2344
Mar 03 2016 17:34
Yeah, our "edge" node is the Zuul proxy and that's where it shows up
The call to the user microservice succeeds and exits cleanly, but the timeout happens before it's done
Dave Syer
@dsyer
Mar 03 2016 17:35
The user guide has a few settings you can try#
e.g.
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000
ribbon:
  ConnectTimeout: 3000
  ReadTimeout: 60000
David Welch
@dwelch2344
Mar 03 2016 17:36
Ahhh, that makes more sense. Those configs live at the ribbon level, not Zuul
Dave Syer
@dsyer
Mar 03 2016 17:36
Assuming you use ribbon
Spencer Gibb
@spencergibb
Mar 03 2016 17:37
that’s just what I was looking for. Zuul uses ribbon
Dave Syer
@dsyer
Mar 03 2016 17:37
Not if you configure the URL directly
David Welch
@dwelch2344
Mar 03 2016 17:37
Eureka! that was it
Spencer Gibb
@spencergibb
Mar 03 2016 17:37
True, but he is using consul.
nice, glad we could help.
David Welch
@dwelch2344
Mar 03 2016 17:38
Yeah, using consul for the service discovery... which is awesome. Thanks to both of you, appreciate it
David Welch
@dwelch2344
Mar 03 2016 18:27
@spencergibb another Zuul question for you: it seems like response headers are unavailable to Zuul post-filters. So, if UserService responds with the header X-FOO=bar, a Zuul post filter isn't seeing that via RequestContext.getCurrentContext.getResponse().getHeader("X-FOO")
I realize this isn't really a Spring Cloud question, but in theory shouldn't the proxied response from origin be fully accessible in these post-filters?
Dave Syer
@dsyer
Mar 03 2016 18:41
It probably is (spring cloud). Because Zuul is pretty thin on its own.
Jacques-Etienne Beaudet
@jebeaudet
Mar 03 2016 18:41
@dwelch2344 try RequestContext.getCurrentContext().getZuulResponseHeaders(), these are the headers that will get written to the Response by the SendResponseFilter
Dave Syer
@dsyer
Mar 03 2016 18:41
What he said
David Welch
@dwelch2344
Mar 03 2016 18:43
Tried checking those, but nothing's there. Maybe my filter's order is too low, so they're not "populated" or something yet
Jacques-Etienne Beaudet
@jebeaudet
Mar 03 2016 18:45
well, the RibbonRoutingFilter grabs the response received and inject the headers in this map, if it isn't there, it means it's in the ignored list of it wasn't received by the underlying service
David Welch
@dwelch2344
Mar 03 2016 18:45
Yup, that was it. SendResponseFilter's order is 1000, so bumping to 2000 did the trick
I was too close to the heart of the onion ;)
Spencer Gibb
@spencergibb
Mar 03 2016 18:45
nice, thanks @jebeaudet
David Welch
@dwelch2344
Mar 03 2016 18:46
yeah, major thanks
Jacques-Etienne Beaudet
@jebeaudet
Mar 03 2016 18:46
glad I could help