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

grpc multiple services如何注册所有service? #1233

Open
slowargo opened this issue Jan 23, 2024 · 6 comments
Open

grpc multiple services如何注册所有service? #1233

slowargo opened this issue Jan 23, 2024 · 6 comments

Comments

@slowargo
Copy link

slowargo commented Jan 23, 2024

Describe the bug

升级到0.8.0后, 所有的method都注册在CombineService下, 只能使用CombineService的client访问. 客户端如果使用xxxService访问会报错error=unknown service

To Reproduce
server upgraded to kitex 0.8.0

Expected behavior
在不改client的前提下, 如何让method除了注册到CombineService, 也注册到它所属的Service名下?

Screenshots

If applicable, add screenshots to help explain your problem.

Kitex version:

Please provide the version of Kitex you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

@slowargo slowargo changed the title grpc multiple services注册所有service? grpc multiple services如何注册所有service? Jan 23, 2024
@HeyJavaBean
Copy link
Member

  1. 在 0.8.0 之前应该也是这个行为
  2. 可以等这个月月底左右,我们会发布一个新版本,能直接支持注册多个 service 的操作(像 google grpc 一样),而不再采用 combine-service 这种方式

@slowargo
Copy link
Author

slowargo commented Jan 23, 2024

0.8.0前会忽略service, 所以不会调用失败
0.8.0这个feature算是breaking change

@HeyJavaBean
Copy link
Member

哦,记错了。grpc 场景一直会检查 service name。服务端也需要用 combine service 注册才行。

@GuangmingLuo
Copy link
Member

欢迎试用 Kitex 单 Server 多 Service (Multiple Service),相对于 Combine Service,这个模式更加推荐,不会生成冗余的代码,客户端也不需要变更。 https://www.cloudwego.io/zh/docs/kitex/tutorials/advanced-feature/multi_service/

@slowargo
Copy link
Author

您正在尝试在 Server 上同时注册 Combine Service 和其他 Service 。 请注意,Combine Service 只能在 Server 上单独注册。如果您还想注册其他 Service ,则需要将这些 Service 合并到 Combine Service 中,或者在不使用 Combine Service 的情况下单独注册每个 Service 。

所以要先把使用combine service的client都改了, 才能在server改成多 Service?

@felix021
Copy link
Contributor

felix021 commented Mar 11, 2024

您正在尝试在 Server 上同时注册 Combine Service 和其他 Service 。 请注意,Combine Service 只能在 Server 上单独注册。如果您还想注册其他 Service ,则需要将这些 Service 合并到 Combine Service 中,或者在不使用 Combine Service 的情况下单独注册每个 Service 。

所以要先把使用combine service的client都改了, 才能在server改成多 Service?

Multi Service 是把每个 Service 独立注册到 server 里,所以用对应 service 的 client 发起请求就行。

Client 端可以不用变,主要是 server 需要从 combineservice 的用法迁移过来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants