19 Star 19 Fork 7

JJZHK-Tools / zkRpc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ReadMe.md 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
JJZHK 提交于 2020-09-09 15:46 . 修改readme

Images

服务器端:

<puddo:application port="9092"/>
<puddo:service package="com.jjzhk.rpc.impl"/>
<puddo:registry address="192.168.3.23" port="2181"/>

需要暴露的服务,使用@PuddoService注解进行修饰

客户端:

<puddo:application port="9092"/>
<puddo:registry address="192.168.3.23" port="2181"/>
<puddo:caller interface="com.jjzhk.rpc.interfaces.IRpcServerExample"
              ref="rpcServerExample" interval="1000" trycount="2"/>
<puddo:caller interface="com.jjzhk.rpc.interfaces.IRpcServerExample"
              ref="rpcServerExampleEx" interval="3000" trycount="4"/>
<puddo:caller interface="com.jjzhk.rpc.interfaces.IRpcServerExample2"
              ref="rpcServerExample02" interval="5000" trycount="10"/>

ApplicationContext context = new ClassPathXmlApplicationContext("client.xml");

IRpcServerExample helloService = (IRpcServerExample)context.getBean("rpcServerExample"); String result = helloService.hello("World"); System.out.println(result);

具体参考Rpc-Server和Rpc-Client

主要用法类似于dubbo

捐助

Java
1
https://gitee.com/jjzhk-tools/zkRpc.git
git@gitee.com:jjzhk-tools/zkRpc.git
jjzhk-tools
zkRpc
zkRpc
main

搜索帮助