提交 2e13e43d 编写于 作者: Y YunaiV

dubbo rpc echo

上级 1eec7e6f
......@@ -27,13 +27,18 @@ import com.alibaba.dubbo.rpc.RpcResult;
/**
* EchoInvokerFilter
*
* 回声过滤器
*/
@Activate(group = Constants.PROVIDER, order = -110000)
public class EchoFilter implements Filter {
@Override
public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
if (inv.getMethodName().equals(Constants.$ECHO) && inv.getArguments() != null && inv.getArguments().length == 1)
// 方法名为 `$echo` ,参数只有一个
if (inv.getMethodName().equals(Constants.$ECHO) && inv.getArguments() != null && inv.getArguments().length == 1) {
return new RpcResult(inv.getArguments()[0]);
}
return invoker.invoke(inv);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册