Skip to content

Does ruby-kafka supports Protobuf serialization? #886

Answered by geoff2k
xiaoronglv asked this question in Q&A
Discussion options

You must be logged in to vote

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 the message.value back into an instance.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xiaoronglv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants