We are currently working on a POC that deals with using a 'oneof' to have multiple events into the same topic. However, we seem to be getting a serialization exception when publishing to the union Kafka topics.
We are creating a union protobuf schema that calls the other event schemas using the oneof. These event schemas uses imports coming from google like (google/type/date.proto) that can't be added as references while evolving schemas in the registry.
Currently we are using 6.1.1 schema registry version and not sure if this is the cause or this is the way it works. Below is the error we are facing for your reference. We are not sure if there is any additional setup or configuration that is needed in such a scenario. Appreciate some advise on this !
org.apache.kafka.common.errors.SerializationException: Error serializing Protobuf message at io.confluent.kafka.serializers.protobuf.AbstractKafkaProtobufSerializer.serializeImpl(AbstractKafkaProtobufSerializer.java:106) ~[kafka-protobuf-serializer-6.1.1.jar:na] Caused by: java.io.IOException: Incompatible schema syntax = "proto3"; ERROR 25580 --- [nio-8090-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/kafka_producer_ri] threw exception [Request processing failed; nested exception is org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[3497788AEF9624A-0000000000000000]] with root cause java.io.IOException: Incompatible schema syntax = "proto3";
Thanks