Does ruby-kafka supports Protobuf serialization? #886
-
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? |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
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.value
is 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
#produce
to produce it to a topic, and on the consuming end, you can use protobuf's decoding to turn themessage.value
back into an instance.