Can I use Apache Thrift without RPC?

I searched on the Internet but did not find anything useful. First, I thought about using protocol buffers, but it does not provide a built-in function to track multiple messages (where one message ends and the second starts) or message self-limitation, but I read about this function in Thrift white paper and it seems to be good to me. Now I am thinking of using Thrift instead of protocol buffers.

I am working on a custom protocol because I do not need RPC, can someone tell me if I can use Thrift without RPC (like it in protocol buffers, just use the thread function) and some starting point as transactional documentation is a bit cumbersome.

Thank!

+4
source share
2 answers

Yes it is possible. A similar answer is given here . Apache Assistant can be used without RPC, you can simply use the libraries associated with the transport and protocol layers, as defined in the documentation.

+2
source

Apache Thrift is truly an RPC- and serialization framework . The serialization part is used as part of the RPC mechanism, but can be used autonomously. For different languages ​​there are samples and / or supporting helper classes. If this does not apply to your specific language, the necessary code is largely reduced to this (pseudocode):

var data = InitializeMyDataStructure(...);

var trans = new TStreamTransport(...);
var prot = new TJSONProtocol(trans);

data.write(prot);

() , JSON () . .

.

, . , , / .

+2

Source: https://habr.com/ru/post/1533201/


All Articles