对于使用Spring的基于请求的粘性会话,我有以下配置
spring:
cloud:
discovery.client.simple.instances:
say-hello:
- instanceId: say-hello1
uri: http://localhost:8080
- instanceId: say-hello2
uri: http://localhost:8081
loadbalancer:
configurations: request-based-sticky-session
sticky-session:
add-service-instance-cookie: true
server.port:9090以下呼吁:
$ http :9090/hi 'Cookie:sc-lb-instance-id=say-hello1'应该只访问基于say-hello1的基于请求的LoadBalancer粘性会话实例,而是使用循环负载平衡。
我在这里错过了什么?
下面是试用它的源代码:https://github.com/altfatterz/client-side-loadbalancing
发布于 2021-06-18 15:33:51
这里有两件事需要考虑:
https://stackoverflow.com/questions/68026243
复制相似问题