Repository navigation
Does ruby-kafka supports Protobuf serialization? #886
Answered
by
geoff2k
xiaoronglv
asked this question in
Q&A
|
https://github.com/zendesk/ruby-kafka/wiki/Encoding-messages-with-Avro it supports Avro, does it support protobuf? could you please provide an example about encoring messages with protobuf? |
Answered by
geoff2k
Feb 8, 2021
Replies: 1 comment
|
Note that in the example you linked, ruby-kafka isn't doing any of the avro-related work itself: when producing, the producer is passed the data that has been encoded using AvroTurf, and when consuming, the raw The same should apply to protobuf -- as long as you can generate a protobuf encoded payload, you can call ruby-kafka's |
0 replies
Answer selected by
xiaoronglv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that in the example you linked, ruby-kafka isn't doing any of the avro-related work itself: when producing, the producer is passed the data that has been encoded using AvroTurf, and when consuming, the raw
message.valueis passed back into AvroTurf for decoding.The same should apply to protobuf -- as long as you can generate a protobuf encoded payload, you can call ruby-kafka's
#produceto produce it to a topic, and on the consuming end, you can use protobuf's decoding to turn themessage.valueback into an instance.