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

Question: Deep Protobuf dependency hierarchy in Go service #2228

Closed
pjthepooh opened this issue Apr 6, 2022 · 4 comments
Closed

Question: Deep Protobuf dependency hierarchy in Go service #2228

pjthepooh opened this issue Apr 6, 2022 · 4 comments

Comments

@pjthepooh
Copy link

pjthepooh commented Apr 6, 2022

I have a Go service with big dependency graph of protobuf. There is only one top-level schema I need to register for the topic, but it depends on many protobuf messages in different files and packages. I couldn't find a Go client that can leverage an instance of a protobuf class to register all its references like Java client does with KafkaProtobufSerializer. I wonder what would be a reasonable approach to register and manage schemas in this case.

@pjthepooh pjthepooh changed the title Register multiple messages in protobuf file Question: Register multiple messages in protobuf file Apr 6, 2022
@pjthepooh pjthepooh changed the title Question: Register multiple messages in protobuf file Question: Deep Protobuf dependency hierarchy in Go service Apr 6, 2022
@rayokota
Copy link
Member

rayokota commented Apr 6, 2022

You could try the Schema Registry Maven Plugin: https://docs.confluent.io/platform/current/schema-registry/develop/maven-plugin.html

@pjthepooh
Copy link
Author

pjthepooh commented Apr 7, 2022

Thanks @rayokota this seems to be a significant overhead for our use case, but will look into that.

A follow up question I have is how can one register a protobuf schema from external package (without Java client)? e.g. If I have this

import "google/protobuf/wrappers.proto";

message ExampleSchema {
  int64 foo_count = 1;
  google.protobuf.StringValue string_value = 2;
}

I'd get error

ERROR io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Either the input schema or one its references is invalid; error code: 42201

@rayokota
Copy link
Member

rayokota commented Apr 9, 2022

@pjthepooh , if you use CP 7.0+, the google types do not need to be registered separately, they are built-in.

@rayokota
Copy link
Member

rayokota commented Jul 6, 2022

@rayokota rayokota closed this as completed Jul 6, 2022
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