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

3rd
Oct 2016
ankit8051
@ankit8051
Oct 03 2016 10:06
Guys, is there any fallback mechanism in Spring Cloud Config server?
Dave Syer
@dsyer
Oct 03 2016 10:10
For what purpose?
Spencer Gibb
@spencergibb
Oct 03 2016 10:25
@dwelch2344 that comes from zuul
David Welch
@dwelch2344
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
@wbauern
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
@spencergibb
Oct 03 2016 16:37
@wbauern what have you tried?
Bill Bauernschmidt
@wbauern
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
@spencergibb
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
@wbauern
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);
        client.setLoadBalancer(this.clientFactory.getLoadBalancer(serviceId));

        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
@spencergibb
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.