spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

FeignLoadBalancer can't set loadBalancerKey

Open SkillyZ opened this issue 6 years ago • 3 comments

I want to overwrite Ribbon IRule. public Server choose(ILoadBalancer lb, Object key) but I found 'key' is null. how can I solve?

i know issues/1272 solved。 but this is in the zuul RequestContext.getCurrentContext().set(LOAD_BALANCER_KEY, "any value you want"); my question is how to set loadBalancerKey in the FeignLoadBalancer?

in the 2.0.1.RELEASE

SkillyZ avatar Jun 19 '20 09:06 SkillyZ

@SkillyZ Please switch to the Hoxton release train. Any versions below 2.2.x are not supported anymore.

FeignLoadBalancer extends AbstractLoadBalancerAwareClient. That allows you to override buildLoadBalancerCommand(RibbonRequest request, IClientConfig config) method and pass the key. Is that helpful?

If not, please provide a minimal, complete, verifiable example that shows your usecase.

OlgaMaciaszek avatar Jul 16 '20 13:07 OlgaMaciaszek

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Jul 23 '20 13:07 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Jul 30 '20 13:07 spring-projects-issues