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

Jun 2018
Jun 13 2018 06:20

I can’t seem to get this work:

    public BankClientHystrix getService(String service) {
        return Feign.builder()
                .encoder(new GsonEncoder())
                .target(BankClientHystrix.class, "http://" + service);

The object returned by this method can’t find the service on the registry.

Load balancer does not have available server for client

it’s a custom client. I have working feign clients that work as expected when using @FeignClient
I know there’s a config i should be loading somewhere but i’m not sure how to do it
section 7.3 of the docs doesn’t tell me much
Jun 13 2018 06:54
Okay i think i got it working. apparently the @Autowired constructor handles this and moving forward it uses a LoadBalancerFeignClient. The interface I made must use spring annotations. makes sense and it works.
Raja Sundaram
Jun 13 2018 10:46
I’m using spring-cloud-config-server with Git as a backend. I hoping to secure the credentials username and password to be served from the vault server.
Is there a recommended way? or I am thinking to extend the GitCredentialsProviderFactory and create the credentails bean using createFor() with vaules from the vault?
Anders Engström
Jun 13 2018 11:30
Client-side stateful load-balancing using Ribbon (through cloud discovery with Consul)… anyone any experience with that? There doesn’t seem to be a standard way to propagate a service-locator to an IRule when using a load-balanced RestTemplate afaikt.
We have a slightly non-standard (?) setup where we have sticky entity state in dedicated service-instances, and we need to route a request to the proper down-stream service (round-robin load balancing isn’t enough).
We’ve previously used a home-grown solution where we wired up Ribbon ourselfs and used the LoadBalancerCommand and a custom IRule. But now we would like to use a load-balanced RestTemplate (or WebClient) with the spring-cloud stuff handling balancing behind the scenes instead (if possible).
Marcos Barbero
Jun 13 2018 13:54
@andersenleo a @LoadBalanced RestTemplate basically uses ribbon under the hood, probably you gonna need to use the same approach as you already did.
Matt Benson
Jun 13 2018 21:54
@spencergibb thanks for merging