Thrift Protocol

Thrift Protocol

The Thrift protocol currently supported by Dubbo is an extension of the native Thrift protocol 1, adding some extra header information on top of the base protocol, such as service name, magic number, etc.

Note

Version 2.3.0 and above supported

Using the Dubbo Thrift protocol also requires the Thrift IDL compiler to compile and generate the corresponding Java code. Future versions will enhance this aspect.

Dependencies

  1. <dependency>
  2. <groupId>org.apache.thrift</groupId>
  3. <artifactId>libthrift</artifactId>
  4. <version>0.8.0</version>
  5. </dependency>

Configuration

All services share a common port 2:

  1. <dubbo:protocol name="thrift" port="3030" />

Usage

Refer to the example code in the Dubbo project

Frequently Asked Questions

  • Thrift does not support null values, meaning: null values cannot be passed in the protocol.

  1. Thrift is an RPC framework donated by Facebook to Apache. ↩︎

  2. Not compatible with native Thrift. ↩︎

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)