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

[feature] Publish centrifugo gRPC schema to Buf Schema Registry #851

Closed
kop opened this issue Jul 5, 2024 · 5 comments
Closed

[feature] Publish centrifugo gRPC schema to Buf Schema Registry #851

kop opened this issue Jul 5, 2024 · 5 comments

Comments

@kop
Copy link

kop commented Jul 5, 2024

Nowadays, to start using Centrifugo gRPC API, we have to compile protobufs first.
This is a working solution, but this can be improved.

The Buf Schema Registry provides hosting for Protobuf/gRPC definitions, similar to how package managers work. The giant bonus of BSR is its support for automatic SDKs generation.

By publishing gRPC schemas to BSR, Centrifugo could provide a number of "include-and-use" gRPC SDKs for Go, JS, Rust, Python and other languages.

@kop kop changed the title Publish centrifugo gRPC schema to Buf Schema Registry [feature] Publish centrifugo gRPC schema to Buf Schema Registry Jul 5, 2024
@FZambia
Copy link
Member

FZambia commented Jul 30, 2024

Done in v5.4.3 - https://github.com/centrifugal/centrifugo/releases/tag/v5.4.3

Example for Go can be found in description of #863

@kop please check it out

@kop
Copy link
Author

kop commented Jul 31, 2024

Thank you, @FZambia. I've successfully switched to SDK generated from BSR and everything seems to be running smooth.

One issue I noticed is that I was unable to use the latest version of protocolbuffers/go plugin (v1.34.2). Had to use v1.33.0 instead. The Go module BSR generates does not define the minimum Go version in go.mod, so Go defaults to v1.16. Which does not work because the generated code is using newer syntax available starting from v1.18.

However, this might be a problem with my setup. I have quite a Frankenstein project with dependencies on modules that use old gRPC-related libraries. Maybe this is the reason Go dependency resolution is not happy in my case.

@FZambia
Copy link
Member

FZambia commented Jul 31, 2024

Maybe this is the reason Go dependency resolution is not happy in my case.

Maybe you can try on new project with empty dependencies?

@kop
Copy link
Author

kop commented Aug 2, 2024

Yep. I can confirm, works fine on a project with empty dependencies.

@FZambia
Copy link
Member

FZambia commented Aug 6, 2024

Cool! Closing then.

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