简体   繁体   中英

Interface Python Thrift client with Go gRPC server

Is that possible to begin with? It says in the gRPC FAQ :

Can I use gRPC with my favorite data format (JSON, Protobuf, Thrift, XML) ?

Yes. gRPC is designed to be extensible to support multiple content types. The initial release contains support for Protobuf and with external support for other content types such as FlatBuffers and Thrift, at varying levels of maturity.

But I haven't found any documentation around this? Specifically I want to talk from a Python client (Thrift) to my gRPC server writtein in Go.

No, you cannot have a Python Thrift client communicate with a Go gRPC server.

There are two similar but related things being mixed: the RPC protocol and the message schema/IDL/format.

The RPC protocol between Thrift and gRPC is different. They are not interoperable. This is what you are requesting, and so this is why the answer is no.

The gRPC FAQ is saying that is is possible to use things other than protobuf as the message schema/IDL/format. So that would allow a Python gRPC client talking to a Go gRPC server, but using Thrift messages. grpc-ecosystem/grift contains some unmaintained code that allows generating gRPC stubs from Thrift IDL files, but it doesn't support Python.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM