What is the Hessian protocol?

Source: Internet
Author: User

What is the Hessian protocol?

At present, Web service technology is the mainstream technology to solve the problem of integration and interoperability of heterogeneous platform systems.

The XML on which it is based is already the real standard of exchanging data on the Internet, based on the differences between the common interprocess communication Protocol and the network transport Protocol shielding platform, it can unify the communication and call requests in various heterogeneous environments into standard Web service formats. But because of the structural problems of the SOAP protocol, the encapsulated data expands several times. The problem is not so obvious when the amount of data transferred is small, but when large data is transferred, the transmission performance of the Web service is reduced a lot in actual use. This is not suitable for applications that often have large data-volume data exchanges.
Caucho Technology hbwsp (Hessian Binary Web Service Protocol) [2] has made a breakthrough in this regard. The Hessian protocol is similar to the SOAP protocol commonly used by WebService, and it also encapsulates protocol messages in HTTP packets and transmits them over an HTTP channel. Therefore, the Hessian protocol has the same advantages as the SOAP protocol, that is, the transmission is not restricted by firewalls (firewalls typically do not restrict the HTTP channel).

The advantage of the Hessian protocol is that it encodes data in the local format into binary data, with only one character as a structured tag, and the data increment after the HBWSP package is significantly smaller than the data increment after the SOAP package. And there are 3 significant advantages to external data representation relative to the Soap,hessian protocol:

1) Use simple structured marking. Simple structured markup reduces the amount of memory consumed by encoding and decoding operations. When coding, you can mark the structure by simply writing a small amount of data, and the structure can be determined by simply reading a small amount of data when decoding. Furthermore, simple structured markup reduces the number of encoded data increments.
2) use a fixed-length byte record value. With a fixed-length byte record value, when decoded, you can use a bitwise operation to derive a value from a bit of a constant size. This is not only easy to operate, but also to achieve high performance.
3) Use references to replace objects that are repeatedly encountered. Using references instead of repeating objects avoids encoding duplicate objects and reduces the amount of data that is encoded.

Therefore, the amount of data transmitted using the Hessian protocol is much smaller than the SOAP protocol. It has been proved that the transmission of the same object Hessian protocol is one order of magnitude lower than the SOAP protocol. Therefore, the Hessian protocol is more suitable than the SOAP protocol for data exchange of large data between distributed application systems.

SOAP protocol

The Simple Object Access Protocol is a protocol specification for exchanging data, a lightweight, simple protocol based on XML (a subset of the standard Universal Markup Language) designed to exchange structured and solidified information on the web

SOAP can be used in conjunction with many existing Internet protocols and formats, including Hypertext Transfer Protocol (HTTP), Simple Mail Transfer Protocol (SMTP), Multipurpose Internet Mail Expansion Protocol (MIME). It also supports a large number of applications, from the messaging system to Remote procedure calls (RPCs). SOAP uses a combination of XML-based data structures and Hypertext Transfer Protocol (HTTP) to define a standard method for using distributed objects in various operating environments on the Internet.

Implementation framework of 4.2 Hessian protocol
The implementation of the Hessian protocol is shown in Architecture 3: In order to implement the Hessian architecture, the following components are designed: encoding components, decoding components, communication components, reporting failed components, proxy components, invoking service process components.

First the client makes a local request, the proxy component responds to the request based on the service interface, generates a client stub, and calls the encoding component to the local request for binary encoding based on the Hessian binary Web Service protocol standard. The communication component is then called to send the request to the server side. When a server-side communication component receives a request and forwards the request to the calling service process component, the calling service process component invokes the decoding component first, obtains the process identity, transfers the process identity to the server-side stub, and loads the implementation class for the service process based on the deployment file and the client's request. The service process is then invoked based on the procedure identification and procedure parameters. The last call to the encoding component encodes the response result and returns it to the client through the communication component.
When the data transmission, communication error, you need to enable the reporting of the failure component, it can be in the form of an exception, the sending side, the receiver, or network connection failure, and the error records recorded in the log is saved in the file for future review.

4.3 Implementation structure
According to a series of problems existing in the Internet Transmission of educational administration system, the main data platform based on the Internet realizes the data exchange based on the HBWSP lightweight cross-platform communication technology, 4 shows. On the client side, the application server extracts data from the subject data service layer and encodes the local format data by hbwsp the external data representation. Then through the Internet network for transmission, on the server side, the data Exchange Service is responsible for the data received according to HBWSP external data to decode, and then analyze the data, processing after the data inserted into the server-side topic data Service layer.



Figure 4 Data Exchange solution for non-persistent synchronous mode


The key features of this solution include:
1) using the HBWSP binary coding method solves the communication problem of the remote and heterogeneous platform system, and makes the data interaction have a certain real-time nature.
2) The ability to exchange gigabytes of data is the result of HBWSP's concise coding and high encoding and decoding performance.
3) using the HBWSP binary encoding method helps to shorten the time required for the entire data exchange. Its high coding performance can help increase the encoding speed and reduce the time of the sender to encode local data. The characteristics of high decoding performance can reduce the time of decoding and reconstructing local data by the receiving party. This reduces the response time of the data exchange.
4) The use of HBWSP binary encoding and data batching technology can help to make full use of the network in good condition of the time. Data exchange can be done as much as possible during periods of good network conditions.
5) The use of breakpoint continuation technology, to ensure that when the network disconnection or response time-out caused the ongoing data exchange is interrupted, after the fault repair can still start from the point of interruption, continue to complete the last incomplete data exchange ability. The granularity of a breakpoint can be adjusted, either as a single piece of data or as multiple data.
6) using a transaction protection mechanism, each batch of data to be transferred is defined as a transaction, the transaction integrity of the data to be transmitted in this batch does not depend on the batch data that has been completed, the data transmission errors in this batch will not affect the completed batch data. With this method, the integrity of the data exchange transaction can be ensured when the data exchange process is interrupted.

What is the Hessian protocol?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.