fasterRPC 介绍
基于java AIO实现的RPC调用框架,封装完全屏蔽IO通信层,使用者就像调用本地API一样调用RPC接口
服务端初始化
public static void main(String[] args) throws Exception { new FastRpcServer() .threadSize(20) .register("test", new TestService()) .bind(4567) .start(); }
客户端初始化
public static void main(String[] args) { try(IClient client = new FastRpcClient()) { client.connect(new InetSocketAddress("127.0.0.1", 4567)); ITestService service = client.getService("test", ITestService.class); String say = service.say("Hello!"); System.out.println(say); } catch (Exception e) { e.printStackTrace(); } }
fasterRPC 官网
http://git.oschina.net/pyinjava/fastrpc
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。