Protocol Overview

Protocol Overview

Protocol Overview

As an RPC framework, Dubbo has an efficient built-in RPC communication protocol that helps solve coding and communication issues between services. The currently supported protocols include:

  • triple, a high-performance communication protocol based on HTTP/1 and HTTP/2, 100% compatible with gRPC, supporting Unary, Streaming, and other communication modes; allows publishing REST-style HTTP services.
  • dubbo, a high-performance private communication protocol based on TCP, with the drawback of lower general applicability, more suitable for use between Dubbo SDKs;
  • Any protocol extension, by extending protocol, any RPC protocol can be supported, with official ecosystem libraries providing support for JsonRPC, thrift, etc.

Protocol Selection

How should developers decide which protocol to use? The following is our comparative analysis of multiple mainstream protocols from aspects like use cases, performance, ease of programming, and multilingual interoperability:

Protocol Performance Gateway Friendly Streaming Multilingual Support Programming API Description
triple High High Supports client stream, server stream, bidirectional stream Supports (Java, Go, Node.js, JavaScript, Rust) Java Interface, Protobuf(IDL) The most balanced protocol implementation in terms of multilingual compatibility, performance, gateway, Streaming, gRPC, etc., recommended by the official team.
Supports application/json formatted payload for direct HTTP access.
dubbo High Low Not supported Supports (Java, Go) Java Interface The highest performance private protocol, but has higher costs for frontend traffic access and multilingual support

Here is the specific development, configuration, and runtime information for the two main protocols, triple and dubbo:

Protocol Name Configuration Value Service Definition Methods Default Port Transport Layer Protocol Serialization Protocol Default
triple tri - Java Interface
- Java Interface+SpringWeb Annotation
- Java Interface+JaxRS Annotation
- Protobuf(IDL) 50051 HTTP/1, HTTP/2 Protobuf Binary, Protobuf-json No
dubbo dubbo - Java Interface 20880 TCP Hessian, Fastjson2, JSON, JDK, Avro, Kryo, etc. Yes

Note

  • Since version 3.3, the triple protocol supports publishing standard HTTP services in a REST style, so there is no longer an independent REST protocol extension implementation in the framework.
  • Considering compatibility with past versions, all current Dubbo release versions default to using the dubbo communication protocol. For new users, we strongly recommend clearly configuring the use of thetriple protocol from the beginning, and existing users should refer to the documentation for a smooth migration of protocols as soon as possible.

Multi-Protocol Extensions

Below are the extension protocol implementations currently provided by the Dubbo official ecosystem. For information on extending more custom protocols, please refer to SPI extension manual or usage tutorial - protocol extension .

Protocol Configuration Value Description
Hessian hessian RPC communication protocol defined by Hessian, see Hessian Protocol for details
Spring HTTP http Private protocol based on HTTP defined by Spring, see Hessian Protocol for details
Apache Thrift thrift Thrift protocol known for its high performance and multilingual support, see Thrift Protocol for details
JsonRPC jsonrpc See JsonRPC for details
RMI rmi See RMI Protocol for details
WebService webservice See WebService Protocol for details

Feedback

Was this page helpful?

Yes No

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