All Projects → 2YSP → rpc-spring-boot-starter

2YSP / rpc-spring-boot-starter

Licence: other
自定义rpc框架,支持Java序列化和protobuf序列化协议,多种负载均衡算法

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to rpc-spring-boot-starter

Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (+70.67%)
Mutual labels:  protobuf, netty, zookeeper
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (+5.33%)
Mutual labels:  protobuf, netty, zookeeper
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+30.67%)
Mutual labels:  protobuf, netty, zookeeper
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+609.33%)
Mutual labels:  protobuf, netty
cheshuo
🎃A lightweight game server framework. Based on Springboot and Netty. Using ProtoBuf as communication between client and server.
Stars: ✭ 23 (-69.33%)
Mutual labels:  protobuf, netty
Summer
这是一个支持分布式和集群的java游戏服务器框架,可用于开发棋牌、回合制等游戏。基于netty实现高性能通讯,支持tcp、http、websocket等协议。支持消息加解密、攻击拦截、黑白名单机制。封装了redis缓存、mysql数据库的连接与使用。轻量级,便于上手。
Stars: ✭ 336 (+348%)
Mutual labels:  protobuf, netty
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 (+172%)
Mutual labels:  netty, zookeeper
Jforgame
jforgame是一个一站式游戏服务器开发框架。包含游戏服,跨服,匹配服,后台管理系统等模块。同时提供大量业务案例以供学习。
Stars: ✭ 601 (+701.33%)
Mutual labels:  protobuf, netty
Brpc Java
Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Stars: ✭ 647 (+762.67%)
Mutual labels:  protobuf, netty
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+2761.33%)
Mutual labels:  protobuf, netty
Him Vue
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 142 (+89.33%)
Mutual labels:  protobuf, netty
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+2538.67%)
Mutual labels:  protobuf, netty
netty-chat-tutorial
Netty Chat tutorial with Protobuf
Stars: ✭ 23 (-69.33%)
Mutual labels:  protobuf, netty
Im
IM server based on netty. Provides a client jar. Integrate with your own login system.基于netty实现的IM服务端,提供客户端jar包,可集成自己的登录系统
Stars: ✭ 490 (+553.33%)
Mutual labels:  protobuf, netty
Mini Rpc
Spring + Netty + Protostuff + ZooKeeper 实现了一个轻量级 RPC 框架,使用 Spring 提供依赖注入与参数配置,使用 Netty 实现 NIO 方式的数据传输,使用 Protostuff 实现对象序列化,使用 ZooKeeper 实现服务注册与发现。使用该框架,可将服务部署到分布式环境中的任意节点上,客户端通过远程接口来调用服务端的具体实现,让服务端与客户端的开发完全分离,为实现大规模分布式应用提供了基础支持
Stars: ✭ 205 (+173.33%)
Mutual labels:  netty, zookeeper
eagle
Eagle分布式rpc调用,借助Zookeeper实现服务注册和发现,基于AQS实现高性能连接池,支持分布式追踪、监控、过载保护等配置。提供Spring和SpringBoot插件,方便与Spring和SpringBoot集成。
Stars: ✭ 77 (+2.67%)
Mutual labels:  netty, zookeeper
Nettyrpc
A simple RPC framework based on Netty, ZooKeeper and Spring
Stars: ✭ 1,975 (+2533.33%)
Mutual labels:  netty, zookeeper
Mango
A high-performance, open-source java RPC framework.
Stars: ✭ 150 (+100%)
Mutual labels:  netty, zookeeper
Almost Famous
🌟 Almost-Famous(成名之路) ——卡牌游戏开源项目,架构使用SpringBoot+Netty+Maven+SpringCloud来搭建多进程分布式框架,包括Cloud、Unique、Login、Game、Match、Battle 等服务。
Stars: ✭ 131 (+74.67%)
Mutual labels:  protobuf, netty
Him Netty
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 194 (+158.67%)
Mutual labels:  protobuf, netty

rpc-spring-boot-starter

利用netty实现的rpc框架

  • 支持Java序列化和protobuf序列化协议
  • 支持多种客户端负载均衡(随机、轮询、加权轮询和平滑加权轮询)算法

使用方法

  1. 下载代码到本地
git clone https://github.com/2YSP/rpc-spring-boot-starter.git
  1. 打包到本地
mvn  clean install -DskipTests=true
  1. 添加maven依赖到你的项目中
  <dependency>
           <groupId>cn.sp.rpc</groupId>
           <artifactId>rpc-spring-boot-starter</artifactId>
           <version>1.0.0-SNAPSHOT</version>
       </dependency>

客户端

使用@InjectService注解注入远程方法

@RestController
@RequestMapping("test")
public class TestController {

   @InjectService
   private UserService userService;

   @GetMapping("/user")
   public ApiResult<User> getUser(@RequestParam("id")Long id){
       return userService.getUser(id);
   }
}

配置项:

属性 含义 可选项
sp.rpc.protocol 消息序列化协议 java,protobuf,kryo
sp.rpc.register-address 注册中心地址 默认localhost:2181
sp.rpc.load-balance 负载均衡算法 random
round
weightRound
smoothWeightRound

服务端

提供远程方法并注入IOC

import cn.sp.rpc.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Service
public class UserServiceImpl implements UserService{

   private static  Logger logger = LoggerFactory.getLogger(UserService.class);


   @Override
   public ApiResult<User> getUser(Long id) {
       logger.info("现在是【2】号提供服务");
       User user = new User(1L,"XX",2,"www.aa.com");
       return ApiResult.success(user);
   }
}

注意: 这里的@Service注解不是Spring的。

配置项:

属性 含义 可选项
sp.rpc.protocol 消息序列化协议 java,protobuf,kryo
sp.rpc.register-address 注册中心地址 默认localhost:2181
sp.rpc.server-port 服务端通信端口号 默认9999
sp.rpc.weight 权重 默认1

用法 demo https://github.com/2YSP/rpc-example

文章:https://www.cnblogs.com/2YSP/p/13545217.html

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].