-
Notifications
You must be signed in to change notification settings - Fork 807
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
Integrate Polaris go sdk to support their service governance ability. #421
Comments
需要考虑一点:为避免冲突,需要关闭框架侧支持的熔断机制,在接入的时候避免调用 |
另外,Polaris没有接入重试机制,可以在contrib仓库中提供基本的重试策略方便用户配置。 |
限流不建议通过mw添加,可以扩展limiter接口 |
其他都没有太大问题,路由和负载均衡这部分,我建议通过以下思路进行对接: 这2个接口,北极星这边会开发,五一后会提供 |
@andrewshan 重新修改了实现,按目前的接口只需要在picker.Next()函数内同时集成动态路由和负载均衡的逻辑即可。Kitex扩展需要支持Resolver/LoadBalancer/Picker三个接口。 |
@jayantxie 按照你的新实现,使用哪些接口呢? |
@andrewshan 需要用到ProcessRouters和ProcessLoadBalance |
routerAPI已经发起PR,可以看看@jayantxie |
Hi, I want to choose module 🙌🏻 |
为方便Kitex用户上云,计划对接腾讯的开源服务治理平台Polaris,通过集成go sdk,满足诸如服务注册发现、熔断限流和动态路由等Polaris平台的治理能力。目前已实现的功能有服务的注册发现,contrib仓库链接 -> registry-polaris。
分点描述各部分能力与Kitex集成的方案:
熔断降级:
Polaris对熔断的实现是请求结束后,调用consumer接口上报单实例请求结果,再在选择实例时剔除故障实例,参考使用故障熔断。在registry-polaris中,已经完成了服务发现的接入,因此,只需要再添加上报ServiceCallResult的Middleware即可。
限流:
在feat: extend outside limiter implementation and fix problems of rate limiter of multiplexed server #431 中,扩展支持了外部限流器的实现,在代码中可通过
WithConcurrencyLimiter
和WithQPSLimiter
传入限流器。与gRPC接入类似,Kitex框架扩展Resolver和Balancer,在Resolver中解析出所有的服务实例。
kitex/pkg/discovery/discovery.go
Line 56 in 6c033d9
这个实现可以保留contrib仓库registry-polaris的实现。
动态路由和负载均衡的逻辑需要嵌入到LoadBalancer的实现内。目前Kitex框架默认的
weightedBalancer
和weightedPicker
需要换成Polaris的实现。细节是:The text was updated successfully, but these errors were encountered: