# Schema registry protobuf serialization

**URL:** <https://forum.confluent.io/t/schema-registry-protobuf-serialization/5846>\
**Category:** Lounge\
**Created:** [22 August 2022 12:36 UTC](https://forum.confluent.io/t/schema-registry-protobuf-serialization/5846 "2022-08-22T12:36:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shukla-Ankur](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/shukla-ankur/32/2120_2.png) [@Shukla-Ankur](https://forum.confluent.io/u/Shukla-Ankur)\
**Post date:** [22 August 2022 12:36 UTC](https://forum.confluent.io/t/schema-registry-protobuf-serialization/5846/1 "2022-08-22T12:36:46Z")

</div>

Hey folks, need help with a potential bug in protobuf serialization.

Confluent-kafka-go v1.9.2

1. I am creating a go application where clients can send any message using the **Any** type field of protobuf.

2. After converting the API input to protoreflect.ProtoMessage type using` anypb.UnmarshalNew(doc.GetDetails(), proto.UnmarshalOptions{})`, I am using `protobuf.Serialize(topic, msg)`.

3. 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 in `protobuf.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.
