1. Overview
1.1 Plugin Name
- Brpc Plugin
1.2 Appropriate Scenario
- a plugin that converts http protocol requests into the Brpc framework protocol
1.3 Plugin code
-
Core Module
shenyu-plugin-brpc -
Core Class
org.apache.shenyu.plugin.brpc.BrpcPlugin
1.4 Added Since Which shenyu version
- Since ShenYu 2.5.1
2. Brpc plugin
2.1 Plugin Setting
-
Add related dependencies and enable plugin, please refer to: Quick start with Brpc .
-
Brpcclient access, please refer to: Brpc Proxy .
2.2 Metadata
Each Brpc interface method, will correspond to a metadata, when the Brpc application client access to the Apache ShenYu gateway, will be automatically registered, can be viewed in the shenyu-admin background management system of the BasicConfig --> Metadata management.
-
AppName: specifies the name of the application to which the metadata belongs.
-
MethodName: the name of the method to call.
-
Path: http request path.
-
PathDescribe: the description of the path is easy to view.
-
ParamsType: the parameters are separated by commas (,) in the order of interface parameter types.
-
RpcExpand: description of each interface in a
Brpcservice. For example, here is the interface information for theBrpcservice:
{
"methodInfo":[
{
"methodName":"getUser",
"paramTypes":[
{
"left":"java.lang.Long",
"right":"userId"
}
]
}
]
}
-
Interface: The fully qualified class name of the
Brpcinterface. -
RpcType:choose
Brpc.