I am using protobuf as serialization to send DomainEvent(s) from one 
microservice to another one.
So from one side i am sending messages to a Kafka topic (messages are 
protobuf serialized DomainEvent like UserCreated(...) or UserUpdated(...)) 
and it works good.
My .proto file is simple like

message UserCreated {
...
}

message UserUpdated {
...
}

The problem is that when reading from the other side i need to know the 
specific type/class of the message like UserCreated(...) vs 
UserUpdated(...).
How can i know if the bytes received from Kafka are a UserCreated message 
or a UserUpdated message?
Do i need to create the .proto file in a different way? Do i need to store 
the message type somewhere in the .proto file?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to