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

Interoperability issues due to proto inconsistencies between spec and language-specific SDKs #744

Open
v3n opened this issue Dec 6, 2021 · 5 comments

Comments

@v3n
Copy link

v3n commented Dec 6, 2021

Hi, we've run into a fairly high severity issue using CloudEvents with Go.go-sdk uses a different Protobuf descriptor from the descriptor defined in the spec and other SDKs.

We're developing on top of Cloudevents in a mixed language ecosystem (primary Java & Go, using Protobuf as our schema and interoperability layer. Producers use the HTTP protocol to a collection, which outputs to the Kafka binding where producers pick up events).

There are a number of interoperability issues we've run into so far, namely due to Go using an inconsistent version of the protobuf definition:

protoc-generated Go cannot import the spec.

  • The spec defines the Go import as cloudevents.io/genproto. This module does not exist.

Since this repository doesn't exist, anything generated from Go doesn't work. This could be solvable via go.mod replace directives except....

Different protobuf packages

  • The spec defines the protobuf as package io.cloudevents.v1;
  • This repository defines the protobuf as package pb;

While wire format interoperability is unaffected, this causes protoreflect to not work between languages. For example: embedding a CloudEvents type via google.protobuf.Any or using protojson

Solution

  • Create cloudevents.io/genproto
  • sdk-go uses the canonical protobuf defined by cloudevents.io/genproto
@n3wscott
Copy link
Member

n3wscott commented Dec 6, 2021

Thanks, will take a look.

@n3wscott
Copy link
Member

OK! the correct proto file is here and we need to copy it down.

https://github.com/cloudevents/spec/blob/v1.0.1/spec.proto

@jskeet
Copy link

jskeet commented Jan 21, 2022

@n3wscott: Note that that proto is slightly out of date - it doesn't include batch support (and doesn't have a csharp_namespace option, although that shouldn't affect go). The most up-to-date one is at https://github.com/cloudevents/spec/blob/main/cloudevents/formats/cloudevents.proto - I'm expecting to use that as the basis of the GA version in 1.0.2 assuming the vote passes.

@AndreasBergmeier6176
Copy link
Contributor

This is more than half a year old - is this repo even maintained anymore?

@n3wscott
Copy link
Member

It is maintained by volunteers. Would you like to contribute @AndreasBergmeier6176 ?

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

4 participants