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

27th
Oct 2017
vwyuheng
@vwyuheng
Oct 27 2017 07:54
有换工作的吗
Patrick Cornelißen
@pcornelissen
Oct 27 2017 08:14
pardon?
git.toutiao.im
@javahongxi
Oct 27 2017 08:57
什么公司
Niklas Herder
@herder
Oct 27 2017 11:34
Hi, I can't seem to find docs on how to create a FeignClient which uses Eureka manually, and not via the @FeignClient annotation... Could anyone give me a pointer in the right direction?
This is what I'm using now, but it uses the url variable as a literal address instead of a service id:
  @Bean
  public UserServiceClient userServiceClient(Contract feignContract,
                                             Encoder feignEncoder,
                                             Decoder feignDecoder,
                                             Client abSptPropertyOkHttpClient,
                                             SecuredRoutesProperties properties,
                                             @Value("${userservice.url:http://userservice}") String url) {
    return Feign.builder()
        .contract(feignContract)
        .encoder(feignEncoder)
        .decoder(feignDecoder)
        .client(abSptPropertyOkHttpClient)
        .requestInterceptor(authInterceptor(properties))
        .target(UserServiceClient.class, url);
  }
Niklas Herder
@herder
Oct 27 2017 11:40
Or, alternatively: is it safe to have multiple @EnableFeignClients with their own basePackageClasses field, so that they don't get each other's RequestInterceptors ?
Mark Corkery
@KramKroc
Oct 27 2017 12:06
Hi folks, are there any general rules of thumb or good articles on performance tuning ribbon connections? If searched but found little. I’ve tweaked coreSize’s for threadpools and also the MaxConnectionsPerHost properties for the ribbon client but haven’t seen a corresponding improvement in the amount of transaction that are successfully processing requests.
Seeing loads of these
Caused by: com.netflix.client.ClientException: , code=9->SERVER_THROTTLED                                                                                                                                                                                                      │
Dave Syer
@dsyer
Oct 27 2017 12:08
You should probably use @FeignClient(configuration=...) rather than trying to do multiple base packages.
@herder ^^
Niklas Herder
@herder
Oct 27 2017 12:12

Thanks, though I tried that before, and that makes the clients which use my starter confused about which FeignClient to use, causing the app to refuse to start.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in class path resource [com/schibsted/publishing/auth/config/UserDetailsConfig.class]: Unsatisfied dependency expressed through method 'userDetailsService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.schibsted.publishing.auth.config.UserServiceClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'feign.Client' available: expected single matching bean but found 2: abLinkpulseOkHttpClient,abSptPropertyOkHttpClient

All clients seem to pick up all defined ReqestInterceptors even though I only want this interceptor to be used by one particular FeignClient

@dsyer Confuring it manually makes the client app less confused, but then I can't seem to get Ribbon/Eureka to kick in
This is in a starter, btw
I do this import in my autoconfig class, but I don't know if it's correct:
@Import( {FeignRibbonClientAutoConfiguration.class, FeignClientsConfiguration.class})
Niklas Herder
@herder
Oct 27 2017 12:40
Found the problem: the client abSptPropertyOkHttpClient was not a load-balanced one... :blush:
Sushant Borse
@sushant91265_twitter
Oct 27 2017 13:28
hi, how to instrument spring-cloud-zuul in a best way ?
Patrick Cornelißen
@pcornelissen
Oct 27 2017 18:58
what do you want to measure?