基于 netty 的 RPC 框架 simple-rpc

码农软件 · 软件分类 · RPC/XMLRPC项目 · 2019-04-11 10:12:04

软件介绍

simple-rpc 是一款基于 netty 的 RPC 框架,现有功能

  • 基本的客户端、服务端交互

  • 提供代理实现接口

  • spring 集成, xml配置和Java Config配置方式

  • 服务发布订阅 DONE

  • 断线重连 DONE

RoadMap

  • 服务心跳检测

  • 连接池

  • 服务注册发布功能

  • 服务管理、监控

  • 服务调用日志链路跟踪

  • 集成swagger功能,提供文档、测试、客户端生成

使用示例

// 服务接口
public interface IHello {
`
    String say(String hello);

    int sum(int a, int b);
    int sum(Integer a, Integer b);
}
// 服务实现
public class HelloImpl implements IHello {
    public String say(String hello) {
        return "return " + hello;
    }

    public int sum(int a, int b) {
        return a + b;
    }

    public int sum(Integer a, Integer b) {
        return a + b * 3;
    }

}

// 客户端代码
// beanJavaConfig方式
@Bean
    public CountService countService() {
        RpcClientWithLB rpcClientWithLB = new RpcClientWithLB("fyes-counter");
        rpcClientWithLB.setZkConn("10.4.105.252:2181");
        rpcClientWithLB.init();
        CountService countService = rpcClientWithLB.newProxy(CountService.class);
        return countService;
    }

// 服务端发布
// xml配置方式
<bean class="com.github.liuzhengyang.simplerpc.ServerFactoryBean" init-method="start">
        <property name="serviceInterface" value="com.test.liuzhengyang.CountService"/>
        <property name="port" value="8888"/>
        <property name="serviceName" value="fyes-counter"/>
        <property name="serviceImpl" ref="countServiceImpl"/>
        <property name="zkConn" value="127.0.0.1:2181"/>

本文地址:https://codercto.com/soft/d/3333.html

2小时品牌素养

2小时品牌素养

邓德隆 / 2009-1 / 38.00元

《2小时品牌素养(第2版)》第一次系统发布有关中国企业的品牌竞争力分析报告,揭示了中国一流企业在品牌战略上面临的深重危机,提出了定位突围之道和实践方法。全书分上下两篇,上篇详细分析了定位的原理,给出定位的三种方法,并特别为中国企业走向世界指出了三条出路;下篇以王老吉品牌战略历程为例,细致论述了一个品牌打造的完整过程,并就品牌实践中的许多关键问题进行了阐述和研讨。作为兼顾理论和实践的第2版,《2小时......一起来看看 《2小时品牌素养》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试