spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.52k stars 3.32k forks source link

Does Gateway support IP hash load balance? #759

Closed wpstan closed 5 years ago

wpstan commented 5 years ago

hello,Does Gateway support IP hash load balance?

How can I implement the IP hash load balance in springcloud gateway?

thanks very much.

ryanjbaxter commented 5 years ago

No we just support load balancing via Ribbon http://cloud.spring.io/spring-cloud-static/Finchley.SR2/single/spring-cloud.html#_loadbalancerclient_filter

wpstan commented 5 years ago

No we just support load balancing via Ribbon http://cloud.spring.io/spring-cloud-static/Finchley.SR2/single/spring-cloud.html#_loadbalancerclient_filter

hello, I write a java class extends RouteToRequestUrlFilter, that seemed to meet my needs. Would it have any side effects?

exchange.getAttributes().put(ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR, IPHashedURL);

ryanjbaxter commented 5 years ago

It is impossible for me to know as I dont have the code

spencergibb commented 5 years ago

Closing as answered