All Projects → BBLLMYD → Netty Stroll

BBLLMYD / Netty Stroll

RPC基础通信框架

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Netty Stroll

fire-im
分布式IM服务,参考https://github.com/crossoverJie/cim 实现
Stars: ✭ 17 (-77.92%)
Mutual labels:  socket, tcp, netty, zookeeper
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+27.27%)
Mutual labels:  tcp, netty, zookeeper, 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 (+164.94%)
Mutual labels:  rpc, zookeeper, netty
RRQMSocket
TouchSocket是.Net(包括 C# 、VB.Net、F#)的一个整合性的、超轻量级的网络通信框架。包含了 tcp、udp、ssl、http、websocket、rpc、jsonrpc、webapi、xmlrpc等一系列的通信模块。一键式解决 TCP 黏分包问题,udp大数据包分片组合问题等。使用协议模板,可快速实现「固定包头」、「固定长度」、「区间字符」等一系列的数据报文解析。
Stars: ✭ 286 (+271.43%)
Mutual labels:  socket, tcp, rpc
simple-rpc-plus
使用netty和zookeeper技术实现的远程调用框架
Stars: ✭ 16 (-79.22%)
Mutual labels:  netty, zookeeper, rpc
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (+71.43%)
Mutual labels:  rpc, tcp, socket
Mango
A high-performance, open-source java RPC framework.
Stars: ✭ 150 (+94.81%)
Mutual labels:  rpc, zookeeper, netty
Goridge
High-performance PHP-to-Golang IPC bridge
Stars: ✭ 950 (+1133.77%)
Mutual labels:  rpc, tcp, socket
Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+1681.82%)
Mutual labels:  rpc, socket, netty
Socket Mqtt
基于Netty+MQTT的高性能推送服务框架。支持普通Socket、MQTT、MQTT web socket协议。非常方便接入上层业务实现推送业务。
Stars: ✭ 314 (+307.79%)
Mutual labels:  rpc, socket, netty
srpc
一款轻量 高性能的RPC框架,基于netty,整合spring,支持注册中心,多种序列化,负载均衡等
Stars: ✭ 78 (+1.3%)
Mutual labels:  netty, zookeeper, rpc
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+312.99%)
Mutual labels:  rpc, tcp, socket
Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (+66.23%)
Mutual labels:  rpc, zookeeper, netty
Rpc Fromscratch
🌈 从零开始设计一个轻量级分布式 RPC 框架,基于 Spring + Netty + Protostuff + Zookeeper
Stars: ✭ 106 (+37.66%)
Mutual labels:  rpc, zookeeper, netty
Iot Dc3
IOT DC3 is an open source, distributed Internet of Things (IOT) platform based on Spring Cloud. It is used for rapid development of IOT projects and management of IOT devices. It is a set of solutions for IOT system.
Stars: ✭ 195 (+153.25%)
Mutual labels:  rpc, tcp, socket
Simple Rpc
RPC with service discovery base on netty
Stars: ✭ 103 (+33.77%)
Mutual labels:  rpc, zookeeper, netty
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+2470.13%)
Mutual labels:  tcp, socket, netty
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (+2.6%)
Mutual labels:  rpc, zookeeper, netty
Books Recommendation
程序员进阶书籍(视频),持续更新(Programmer Books)
Stars: ✭ 558 (+624.68%)
Mutual labels:  zookeeper, tcp, netty
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 (+590.91%)
Mutual labels:  rpc, tcp, netty

轻量RPC通信

一个完备的 RPC 框架在实现远程调用的基础上通常还有着健康监测、服务治理等方面的相关设施,以及易扩展的良好设计。

主要以学习为目的,围绕通信的部分实践一个轻量级的 RPC 框架。


1. 基础实现

  • 传输 & 协议

    采用 TCP 协议为通信基础,基于 Netty 自定义数据包格式,心跳机制维持 TCP 单一长链接

  • 注册中心

    缺省基于 ZooKeeper 实现服务注册和服务发现,可扩展

  • 序列化

    默认基于 ProtoStuff 实现序列化机制,可扩展

  • 负载均衡

    默认 Random 访问,可扩展

    ...


2. 说明

  • signal-base

    封装了上述提到的 RPC 各基础组件和扩展点;同时将需要发布的上层接口放在 common.service 包下发布

RPC基础模式
  • signal-front

    基于 Netty 实现简易独立的 HttpServer,作为接入的网关层; 同时引入 base 包提供作为 RPC Client 端的基础向下游发起调用

    /** 通过注解和继承 指定path和输入输出类型,扩展接口无需关注通信细节 */
    @HandlerTag(path = "/front") 
    public class TransHandler extends Handler<RequestInfo, ResponseInfo> {
        @Override
        public ResponseInfo handle(RequestInfo requestInfo) {
            // ...
            return respInstance;
        }
    }
    
  • signal-core 、 signal-route 、 signal-data

    引入 base 包、配置 config-rpc.properties 后通过 @RpcServiceTag 发布注册服务,使用 RpcClient.create(XService.class) 远程调用服务,同时可以在 Client 端自行扩展负载均衡策略


3. 应用示例

  • Step-1: 没有扩展注册中心情况下,服务通信默认需要提前安装启动ZooKeeper;

  • Step-2: 确认配置信息,如果ZK正常启动缺省值即可用;

config-rpc.properties

registration.address=host:port          # 注册中心 host:port
server.address=port                     # 当前服务占用的端口
server.basePackage=com.skr.xxx          # 递归扫描配置包下的服务提供者并注册服务

# 一些可选扩展配置

# 序列化:        自定义实现com.skr.signal.base.rpc.letter.serialize.SignalSerializable接口,显示配置后会替换,默认采用 ProtoStuff 
# serializer.impl=com.xxx    
           
# 负载均衡算法:   自定义实现com.skr.signal.base.registry.LoadPolicy接口,默认随机 
# loadPolicy.impl=com.xxx

# 服务发现/注册:  自定义实现com.skr.signal.base.registry.ServiceDiscover/ServiceRegistry接口,默认采用 Zookeeper 
# serviceDiscover.impl=com.xxx
# serviceRegistry.impl=com.xxx

...
  • Step-3: 启动 DataMain、RouteMain、CoreMain、FrontMain;

  • Step-4: 向前置(front)节点发送Http请求

curl  -X POST --data '{"traceId":"traceId","businessId":"businessId","requestKey":"requestKey"}' http://127.0.0.1:9001/front

Response:

{"answer":"[core][route][data]requestKey[data][route][core]"}


应用模型示例

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