Home > Back-end >  Spring Cloud Ribbon custom load balancing strategy of how to get the current Http request object?
Spring Cloud Ribbon custom load balancing strategy of how to get the current Http request object?

Time:09-20

As title, I'm a custom load balancing strategy, think through the content of the Http request to determine which service instance call, what can I do in the strategy for the current Http request object?

CodePudding user response:

By requesting the IP do hash, the same IP assigned to a server, can keep the session

CodePudding user response:

reference 1st floor Info_Qi response:
request IP as hash, the same IP assigned to a server, can keep the session

Thank you for your answer, my problem is unable to get to the request object, feel your answer didn't help me

CodePudding user response:

Top of the

CodePudding user response:

Top of the

CodePudding user response:

Ribbon rewrite ClientHttpRequestInterceptor method for directional obtain ClientHttpResponse thereby, ClientHttpRequestExecution stored inside the current address information, please

CodePudding user response:

Use the RequestContext. GetCurrentContext (); In order to get

CodePudding user response:

The RequestContext. GetCurrentContext request to take out () is null
  • Related