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:
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 |
dubbo
communication protocol. For new users, we strongly recommend clearly configuring the use of the triple
protocol from the beginning, and existing users should refer to the documentation for a smooth migration of protocols as soon as possible.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 |