Home  >  Q&A  >  body text

java - hessian协议和http协议有什么优势和差异?

最近有项目中需要跨语言调用,了解了下hessian协议,感觉好像是http+自己的序列化。但是跨语言调用的时候复杂对象应该是不能序列化的,只能走json。都是ip+端口调用这样hessian的优势是什么?hessian没怎么用过,理解比较浅

PHP中文网PHP中文网2741 days ago564

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:40:44

    Hessian is also a lightweight ws service. The advantage is that you don’t need to care about the process. When calling, it is like calling a local one. After all, it is RMI. For http, you need to do the object parsing yourself,

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:40:44

    hessian is a lightweight RPC service implemented based on the Binary-RPC protocol. It will serialize and deserialize your instances.
    Advantages:

    方便呀,很多事情你不用管,可以穿文件呀,数据大点也可以呀
    

    -----from dubbo's documentation, a description of hessian, you can read-----
    Remote call protocol based on Hessian.

    Number of connections: multiple connections
    Connection method: short connection
    Transmission protocol: HTTP
    Transmission method: synchronous transmission
    Serialization: Hessian binary serialization
    Scope of application: Incoming and outgoing parameter data packets are larger, the provider is larger than the consumer There are many users, and the provider is under great pressure to transfer files.
    Applicable scenarios: page transfer, file transfer, or interoperability with native hessian services
    (1) Constraints:

    Parameters and return values ​​need to implement the Serializable interface
    Parameters and return values ​​cannot be customized to implement List, Map, Number, Date, Calendar and other interfaces. You can only use the implementation that comes with JDK, because Hessian will do special processing and customize the implementation class All attribute values ​​in will be lost.

    reply
    0
  • Cancelreply