受信したthriftデータをデータベースに保存する必要があるため、後で読み取ってthriftクライアントで再度送信できます。thrift で生成されたクラスから一時シリアル化オブジェクトを実行せずに blob として保存する方法。
thrift client A
-> thrift server A
-> database
-> thrift client B
->thrift server B
解決:
class LocalRpcHandler : virtual public LocalRpcIf {
public:
shared_ptr<TMemoryBuffer> memBuff;
shared_ptr<TBinaryProtocol> binProt;
....
void send(const Sample& sample) {
sample.write(binProt.get());
saveToDatabase(memBuff);
}
}