All Projects → PaulWang92115 → RPC

PaulWang92115 / RPC

Licence: Apache-2.0 license
RPC is a highly available pluggable architecture for remote calls

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RPC

Fox
fox is a distributed RPC framework
Stars: ✭ 79 (+154.84%)
Mutual labels:  netty, rpc
Rpc Fromscratch
🌈 从零开始设计一个轻量级分布式 RPC 框架,基于 Spring + Netty + Protostuff + Zookeeper
Stars: ✭ 106 (+241.94%)
Mutual labels:  netty, rpc
Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+4325.81%)
Mutual labels:  netty, rpc
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+216.13%)
Mutual labels:  netty, rpc
Mango
A high-performance, open-source java RPC framework.
Stars: ✭ 150 (+383.87%)
Mutual labels:  netty, rpc
Netty Stroll
RPC基础通信框架
Stars: ✭ 77 (+148.39%)
Mutual labels:  netty, rpc
Simple Rpc
RPC with service discovery base on netty
Stars: ✭ 103 (+232.26%)
Mutual labels:  netty, rpc
Takinrpc
RPC框架,基于netty,实现了远程调用、服务治理等功能
Stars: ✭ 13 (-58.06%)
Mutual labels:  netty, rpc
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+6822.58%)
Mutual labels:  netty, rpc
Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (+312.9%)
Mutual labels:  netty, rpc
Nettyrpc
NettyRPC is high performance java rpc server base on Netty,using kryo,hessian,protostuff support message serialization.
Stars: ✭ 1,131 (+3548.39%)
Mutual labels:  netty, rpc
Thunder
⚡️ Nepxion Thunder is a distribution RPC framework based on Netty + Hessian + Kafka + ActiveMQ + Tibco + Zookeeper + Redis + Spring Web MVC + Spring Boot + Docker 多协议、多组件、多序列化的分布式RPC调用框架
Stars: ✭ 204 (+558.06%)
Mutual labels:  netty, rpc
Nettythrift
Thrift on Netty, support TCP/HTTP/WebSocket at same port. support multiple Protocols at same time. multil Simple Clients with Connection Pool.
Stars: ✭ 60 (+93.55%)
Mutual labels:  netty, rpc
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (+154.84%)
Mutual labels:  netty, rpc
Wheel
关于net nio os cache db rpc json web http udp tcp mq 等多个小工具的自定义实现
Stars: ✭ 45 (+45.16%)
Mutual labels:  netty, rpc
Dapeng Soa
A lightweight, high performance micro-service framework
Stars: ✭ 101 (+225.81%)
Mutual labels:  netty, rpc
Servicetalk
A networking framework that evolves with your application
Stars: ✭ 656 (+2016.13%)
Mutual labels:  netty, rpc
Twjitm
项目基于idea工作环境搭建的框架,添加mybatis3,spring4,springmvc4,以及redis。主要实现通过注解和反射自定义netty私有协议栈,实现在一条socket通道上传递不同的消息,采用支持tcp,udp和http协议
Stars: ✭ 26 (-16.13%)
Mutual labels:  netty, rpc
Krpc
My RPC FrameWork(自己写的RPC框架)
Stars: ✭ 112 (+261.29%)
Mutual labels:  netty, rpc
Doe
自己编写dubbo客户端实现rpc调用,在线调试dubbo接口、dubbo接口可视化测试、自动化测试工具。
Stars: ✭ 183 (+490.32%)
Mutual labels:  netty, rpc

RPC

一个可插拔式高可用 RPC 框架,分布式服务框架。

RPC is a highly available pluggable architecture for remote calls.

RPC 中文简介

  1. RPC 基于 Java 编写,网络通信依赖与 netty,http,socket。
  2. 支持基于配置的底层协议切换,可以选择 netty,http,socket。
  3. 基于 Spring 开发,接口代理类自动注入到客户端,使用 @Autowired 注入即可,用户无需关注底层实现。
  4. 支持 Spring xml 格式配置,通过 xml 完成代理类注入,服务端启动,通信协议选择。
  5. 服务端使用线程池提高并发能力。
  6. 客户端使用 channel 缓存提高并发能力。
  7. 支持多序列化协议,多负载均衡协议选择。

开发中:

  1. 加入 redis 注册中心,以及对应的服务治理容错机制。
  2. 监控模块。
  3. Spring 启动逻辑优化。

RPC introduction

  1. RPC is written in Java, and network communication depends on netty, http, socket.
  2. Support configuration-based underlying protocol switching, you can choose netty, http, socket.
  3. Based on Spring development, the interface proxy class is automatically injected into the client, using @Autowired injection, users do not need to pay attention to the underlying implementation.
  4. Support Spring xml format configuration, complete proxy class injection through xml, server startup, communication protocol selection.
  5. Server-side thread pool improves concurrency.
  6. The client uses the channel cache to improve concurrency.
  7. Support multi-serialization protocol, multi-load balancing protocol selection.

In development:

  1. Add the redis registry and the corresponding service governance fault tolerance mechanism.
  2. Monitoring module.
  3. Spring starts logic optimization.

结构图

avatar

性能表现

首先说明,性能表现测试根据不同的机器和不同的网络环境可能会有所不同,下面的测试结果是基于我自己的机器的。 我的电脑最多起 2000 个并发线程,多了就 OOM 了,在公司的电脑尝试过起 10000 个并发线程,没有任何问题,下面看 2000 个并发线程的表现。 测试类:

	public static void main(String[] args) throws Exception {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("rpc.xml");
		//并行度10000
		int parallel = 2000;

		//开始计时
		long a1 = System.currentTimeMillis();

		CountDownLatch signal = new CountDownLatch(1);
		CountDownLatch finish = new CountDownLatch(parallel);

		for (int index = 0; index < parallel; index++) {
			CalcParallelRequestThread client = new CalcParallelRequestThread(signal, finish, index,applicationContext);
			new Thread(client).start();
		}

		//n个并发线程瞬间发起请求操作
		signal.countDown();
		finish.await();

		long a2 = System.currentTimeMillis();

		String tip = String.format("RPC调用总共耗时: [%s] 毫秒", a2 - a1);
		System.out.println(tip);

	}

avatar 2000 并发 1秒多,还是比较快的。

模块介绍

avatar

  1. rpc-consumer,rpc-provider 是我们的测试模块,服务提供者和服务消费者。
  2. rpc-register 注册中心,里面目前只有 zookeeper 实现。
  3. rpc-procotol 网络协议模块,包括协议,序列化方式,负载均衡。
  4. rpc-framework 一些通用的类。
  5. rpc-spring 与 Spring 结合的核心模块,不论是客户端还是只需要导入这个包就可以了。

快速开始

  1. 不论是客户端还是服务端都需要导入 rpc-spring jar 包。
  2. 在使用的 spring 的配置文件里加入针对 rpc 的配置。
  3. 客户端配置,注意 rpc:procotol 必须比 rpc:service 先配置,rpc:procotol 里面的 role 不配置就代表客户端。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:rpc="http://paul.com/schema" xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://paul.com/schema http://paul.com/schema/rpc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    <rpc:procotol procotol="Dubbo" port="3230" serialize="ProtoStuff" address="47.107.56.23:2181"/>
    <rpc:application name="rpc-client" />
    <rpc:service interfaces="com.paul.service.HelloService" ref="helloService" timeout="5000"/>
</beans>
  1. 服务端配置, rpc:procotol 必须比 rpc:provider 先配置,role="provider" 代表是服务端。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:rpc="http://paul.com/schema" xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://paul.com/schema http://paul.com/schema/rpc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    <rpc:procotol procotol="Dubbo" port="3230" serialize="ProtoStuff" role="provider" address="47.107.56.23:2181"/>
    <rpc:application name="rpc-server" />
    <rpc:provider interf="com.paul.service.HelloService" impl="com.paul.service.HelloServiceImpl" />
    <rpc:provider interf="com.paul.service.UserService" impl="com.paul.service.UserServiceImpl" />
</beans>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].