Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically configuring CloudReactiveFeign for using Ribbon as loadbalancer #20

Open
p4pramod opened this issue Dec 31, 2020 · 0 comments

Comments

@p4pramod
Copy link

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.builder()
.setFallback(new TestInterface() {
@OverRide
public Mono 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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant