Serializing a serialized Thrift struct to Kafka in C++
问题 I have a set of structs defined in Thrift such as the following: struct Foo { 1: i32 a, 2: i64 b } I need to do the following in C++ : (a) Serialize instances of Foo into Thrift-compatible bytes (either using the Binary or Compact Thrift protocol) (b) Send the byte-serialized instances to a Kafka topic Question How I do send the Thrift serialized instances to a Kafka cluster? Thanks in advance 回答1: Figured out the answer to my own question. Serialization The code snippet below illustrates how