-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务地图支持RPC调用关系 #30
Comments
能不能提供一些对应的代码示例 |
以Dubbo 调用为例: 服务接口声明 (服务提供者和服务消费者都会导入这个interface) public interface RpcService {
String hello(String name);
} 服务提供者 @DubboService
public class ProviderImpl implements RpcService{
@Override
public String hello(String name) {
return "RpcService invoke by " + name;
}
} 服务消费者 public class Consumer {
// @DubboReference 类似@autowired 字段注入
@DubboReference
private RpcService rpcService;
public void run(){
rpcServiceA.hello("example consumer")
}
} 源码扫描分析Dubbo依赖关系过程大概如下:
按照我的理解, 不管是什么协议,服务地图依赖关系的扫描总体是分为三块内容,可以提供一个包含以下方法定义的接口,使用者按照该接口去扩展不同协议的调用关系扫描实现
|
这么详细,考虑来个 PR 吗?相关的代码在这里:backend 主要是要寻找代码库来验证是不是准确的。 |
想写的,最近我先研究下,另外如果方便的话,可以先补充下这块逻辑执行过程的文档,后面其他人的上手成本会更低一些 |
我周末写了一部分:https://archguard.org/modules/scanner/sourcecode-api ,我再补充一下。 |
今天尝试写了一下,目前完成了基于注解的服务提供者的简单扫描支持,半成品代码如下:Dubbo Analyser 同时也遇到了一些问题及困惑:
|
@wertycn 针对于现状,是直接 PR,我把 Chapi 的问题一起修了?还是你看你对 Chapi 有没有修改的兴趣? |
|
你可以先看一下,这部分是结合 Antlr 做语法树分析的。 理论上在 按当前的 Antlr 解析器的语法,会先进行 |
非常感谢 , 我试试 |
发布了 Chapi 1.5.7,估计要 10 分钟以后才能在 Maven 仓库下载到 |
Good ~ 已经可以使用了 |
Is your feature request related to a problem? Please describe.
当前服务地图仅支持HTTP API 调用关系,但对于微服务系统,服务间内部调用主要依赖于RPC调用(如Dubbo,GRPC等),这部分信息比HTTP API的调用关系在评价分布式系统状态时会更加重要
Describe the solution you'd like
增加RPC服务地图支持
Describe alternatives you've considered
可以提供服务地图依赖信息扫描的接口,基于该接口实现各框架的依赖关系扫描的组件,代码实现可以开放交给社区贡献或者使用方基于自身服务情况进行实现
The text was updated successfully, but these errors were encountered: