The Hessian protocol is used to integrate Hessian’s services. The bottom layer of Hessian uses Http communication and Servlet to expose services. Dubbo’s default embedded Jetty is implemented as a server.
Hessian is an open source RPC framework of Caucho, whose communication efficiency is higher than the serialization that comes with WebService and Java.
Dubbo’s Hessian protocol can interoperate with native Hessian services, namely:
Serializable
interface.List
, Map
, Number
, Date
, Calendar
and other interfaces, only the implementations that come with JDK can be used, because hessian will do special processing and customize the implementation All attribute values in the class are lost.Hessian is a lightweight RPC service implemented based on the Binary-RPC protocol, serializing and deserializing instances.
Starting from Dubbo 3, the Hessian protocol is no longer embedded in Dubbo, and an independent module needs to be introduced separately.
<dependency>
<groupId>org.apache.dubbo.extensions</groupId>
<artifactId>dubbo-rpc-hessian</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.caucho</groupId>
<artifactId>hessian</artifactId>
<version>4.0.7</version>
</dependency>
<dubbo:protocol name="hessian" port="8080" server="jetty" />
<dubbo:provider protocol="hessian" />
<dubbo:service protocol="hessian" />
<dubbo:protocol id="hessian1" name="hessian" port="8080" />
<dubbo:protocol id="hessian2" name="hessian" port="8081" />
<dubbo:reference id="helloService" interface="HelloWorld" url="hessian://10.20.153.10:8080/helloWorld" />