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

Oct 2016
Oct 03 2016 10:06
Guys, is there any fallback mechanism in Spring Cloud Config server?
Dave Syer
Oct 03 2016 10:10
For what purpose?
Spencer Gibb
Oct 03 2016 10:25
@dwelch2344 that comes from zuul
David Welch
Oct 03 2016 13:49
@spencergibb started seeing it pop up, but only for one service. Guessing load related and needs more instances?
Bill Bauernschmidt
Oct 03 2016 15:21
Trying this again... I need some help overriding the RequestSpecificRetryHandler used by the RibbonLoadBalancingHttpClient. We have a customized version that we had working with the old RestClient but can't figure out how to get it working with the new client in the Camden release. Any tips or examples?
Spencer Gibb
Oct 03 2016 16:37
@wbauern what have you tried?
Bill Bauernschmidt
Oct 03 2016 17:00
@spencergibb Previously I was extending the RestClient and overriding its getRequestSpecificRetryHandler to return my custom handler. I then added this modified RestClient to the Spring context and life was good. I was hoping to do the same with the RibbonLoadBalancingHttpClient but in the Camden code I saw it is being instantiated and returned from the HttpClientRibbonCommandFactory and not pulled from the Spring context (as far as I could tell). I then couldn't figure out a way to add it to the factory. Am I off track here?
Spencer Gibb
Oct 03 2016 17:04
So what is created in HttpClientRibbonCommandFactory is a HttpClientRibbonCommand not the client. RibbonLoadBalancingHttpClient is pulled from the context.
@wbauern :arrow_up:
Bill Bauernschmidt
Oct 03 2016 17:45

@spencergibb Sorry, I meant the RibbonLoadBalancingHttpClient is created via the SpringClientFactory and then put in the HttpClientRibbonCommand returned from the HttpClientRibbonCommandFactory.

   public HttpClientRibbonCommand create(final RibbonCommandContext context) {
        final String serviceId = context.getServiceId();
        final RibbonLoadBalancingHttpClient client = this.clientFactory.getClient(
                serviceId, RibbonLoadBalancingHttpClient.class);

        return new HttpClientRibbonCommand(serviceId, client, context, zuulProperties);

If it is ultimately coming from the context in some way that I'm not grasping (very likely) then I will just go back and try out my original approach again. Thanks!

Spencer Gibb
Oct 03 2016 17:46
the SpringClientFactory is pulling it from the context. First it tries a child context for the specific named ribbon client, then the parent context next.