By providing a unified service provider view through Http, users need not worry about backend Dubbo service version differences or protocol differences. They just need to pass RPC call parameters in an HTTP request to complete an RPC call, simplifying backend service design complexity by implementing HTTP calls to backend Dubbo services.
To unify the format of HTTP calls to backend Dubbo services, facilitating gateway products to achieve HTTP-to-Dubbo call conversion and enhancing the integration of Dubbo with the gateway.
It aims to simplify the RPC call process for consumers by providing an HTTP to Dubbo calling method.
In the service call process, the gateway will assume many of the client’s original functions such as load balancing, service governance, and security, allowing external users to focus more on the call itself.
The URL and Header of the request contain RPC call meta-information, including service name, method name, service group, and service version. The request body contains parameters in json list format. If there are no parameters, it is null
The HTTP response includes the processing status, result, or error type and specific information. The returned body contains only one json object, with code, result, and error fields.
The code indicates the specific status, and result and error (only one will be returned) indicate the call’s return result or error information.
It must be POST.
Format: [http://host/{service}/{method}
or [https://host/{service}/{method}
Service name and method name should be consistent with backend service declarations.
If the URL lacks service or method, it should directly return:
http code | code | detail |
---|---|---|
400 | 3 | service or method not provided |
Headers must contain the following items:
Indicates this HTTP request is an HTTP to Dubbo request. Supported protocols are Dubbo and triple. Configurable options are:
The former indicates conversion to the triple protocol, the latter to the Dubbo protocol.
Optional parameters:
The body contains request parameters, including only one Json object.
This object currently includes two fields:
The param value is a list indicating the method’s parameters, in the same order as the method signature.
Using the object to assemble request parameters allows the protocol to be backward compatible, and new fields may be added to the object in the future.