dubbo upgrade dubbox



Some applications of the author's company use dubbo to expose services. As some newcomers join, many people recommend using dubbox. The difference between dubbo and dubbox, I don't want to go into details here, there is a lot of information on the Internet.

The official documentation of dubbox says that it is backward compatible with dubbo. But I took the latest jar of dubbox, exposed the service, and then used the client of dubbo to call the service, and found that it was not compatible. It is found that when the server accepts the request, an exception occurs in the DecodeableRpcInvocation class, and the number of abnormal lines is 106.
int argNum = in.readInt();

The reason for the exception The packet parsing and decoding is abnormal. This needs to understand the packet format of the dubbo protocol.
When the in object executes the read operation, the message will be read offset one by one. The service provided by dubbox, when executing this line, thinks that the message should be an integer, but it is indeed a String, and the parsing is abnormal.

Then use the beyond tool to make a comparison, compare the source codes of dubbo and dubbox, and find that the class Hessian2Input serialized by the dubbo protocol has not changed.

So boldly modified the DecodeableRpcInvocation source code of dubbox. First determine the version number of the dubbo protocol, pay attention to the coordination version number, not the service version number.

The protocol version number is the dubbo console, the version ticked in the picture above.
If it is 2.0.0 or 2.8.4, it is parsed according to dubbox. In this case, I think the service is the service exposed by dubbox.
Other occasions are parsed in the manner of dubbo.
Then make it into a jar package and upload it to the company's git and maven libraries. Later, when dubbo is upgraded to dubbox, the jar is no longer downloaded from the official website, but is obtained from the company's internal git or maven library.

In the case of such an upgrade, the caller of the dubbo service does not need to be forced to upgrade, because it is decentralized, and the dubbox service can also be called with the client jar of dubbo.



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326937054&siteId=291194637