Hey folks, need help with a potential bug in protobuf serialization.
Confluent-kafka-go v1.9.2
-
I am creating a go application where clients can send any message using the Any type field of protobuf.
-
After converting the API input to protoreflect.ProtoMessage type using
anypb.UnmarshalNew(doc.GetDetails(), proto.UnmarshalOptions{})
, I am usingprotobuf.Serialize(topic, msg)
. -
This fails at
s.toProtobufSchema(protoMsg)
step with following error
error interface conversion: *dynamicpb.Message is not desc.protoMessage: missing method Descriptor
If I use a concrete type inprotobuf.Serialize()
which implements protoreflect.ProtoMessage type, serialization works.Kafka version and other details should not matter here since the code does not even reach those. It fails earlier itself.