A simple RPC exercise program.
依赖:
<dependency>
<groupId>com.goribun</groupId>
<artifactId>naive-server</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
配置文件:naive-rpc.properties
可配置RPC接口扫描路径
scanPackage=cn.wangxs.crm.*.service.*
可配置项目名
appName=crm
依赖:
<dependency>
<groupId>com.goribun</groupId>
<artifactId>naive-client</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
配置文件:naive-rpc.properties
可配置服务host(约定为appName=http://xxx.com)
crm=http://api.crm.wangxs.cn
- 提供方
@RpcService
public interface IDemoService {
String sayHello(User user, Activity activity);
}
- 调用方方
IDemoService demoService = RpcClient.refer(IDemoService.class);
demoService.sayHello(user, activity);
-
client打包
-
支持泛型参数 -
异常处理及传递