feign-reactive icon indicating copy to clipboard operation
feign-reactive copied to clipboard

Programmatically configuring CloudReactiveFeign for using Ribbon as loadbalancer

Open p4pramod opened this issue 4 years ago • 0 comments

I am not able to configure the line .withLoadBalancer(AbstractLoadBalancer.class.cast(getNamedLoadBalancer(serviceName))) to use ribbon DynamicServerlistLoadBalancer. Any help would be appriciated.

IcecreamServiceApi client = CloudReactiveFeign.<IcecreamServiceApi>builder() .setFallback(new TestInterface() { @Override public Mono<String> get() { return Mono.just("fallback"); } }) .setLoadBalancerCommand( LoadBalancerCommand.builder() .withLoadBalancer(AbstractLoadBalancer.class.cast(getNamedLoadBalancer(serviceName))) .withRetryHandler(new DefaultLoadBalancerRetryHandler(1, 1, true)) .build() ) .target(IcecreamServiceApi.class, "http://" + serviceName);

p4pramod avatar Dec 31 '20 08:12 p4pramod