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

如果要使用Ribbon来实现负载均衡,要重写哪个类 #16

Open
dengqx520 opened this issue Sep 1, 2017 · 5 comments
Open

Comments

@dengqx520
Copy link

如果要使用Ribbon来实现负载均衡,要重写哪个类

@linking12
Copy link
Owner

GrpcRouteRoundRobinLbFactory.GrpcRoundRobinLoadBalancer 这是从注册中心拿到地址后负载均衡,真正实现选择合适的地址是GrpcRoutePicker,你可以扩展该个类,由Ribbon选择合适的地址返回给grpc

@dengqx520
Copy link
Author

好的,灰常感谢,gateway 重写,你有什么思路?

@linking12
Copy link
Owner

gateway重写
1:目前是想把oauth2的授权和资源拆分开,目前是耦合在一起的
2:把整个admin的控制台迁移到授权上,而资源只负责转发
3:想办法把zuul替换掉,或者重写zuul的转发

@dengqx520
Copy link
Author

1、2两点我也是这样想的,但是第三点很麻烦

@linking12
Copy link
Owner

也不会麻烦,目前zuul使用的是servlet来转发请求;
可以自己写http接收的网络请求,手动转发到这个servlet上,这样的做法就是把web容器的http转发给替换掉了

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

2 participants