thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rush Manbert <>
Subject Re: usage without RPC
Date Mon, 12 Mar 2012 17:16:54 GMT
Of course you can use Thrift without using the RPC part. We do this in many different forms,
mostly with custom protocols that we have derived from the binary protocol.

The attachment contains a C++ file that uses the TFileTransport to write data into a file
and then read it back. Note that it includes ThriftTest.h, which is generated from thriftSrcDistro/test/ThriftTest.thrift.

If you use the JSON protocol (by commenting out line 20 that defines DENSE and uncommenting
line 18 that defines JSON), you will get the data serilized as a string. The binary protocol
also works. I'm not sure about the dense protocol.

You can see that the basic method to serialize is to make a Thrift structure, then call its
write() method, passing a protocol.

I can't comment on the C support. Haven't tried it.

- Rush

View raw message