All Projects → 1ssqq1lxr → Rmessage

1ssqq1lxr / Rmessage

Licence: other
Reactive Programming Multi-protocol push service

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rmessage

T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+5686.96%)
Mutual labels:  tcp, udp, im
Mobileimsdk
一个原创移动端IM通信层框架,轻量级、高度提炼,历经8年、久经考验。可能是市面上唯一同时支持UDP+TCP+WebSocket三种协议的同类开源框架,支持iOS、Android、Java、H5,服务端基于Netty。
Stars: ✭ 3,864 (+16700%)
Mutual labels:  tcp, udp, im
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+326.09%)
Mutual labels:  tcp, udp, netty4
Reactor Netty
TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
Stars: ✭ 1,743 (+7478.26%)
Mutual labels:  tcp, udp, reactor3
node-drivers
Industrial protocol drivers in node.js
Stars: ✭ 20 (-13.04%)
Mutual labels:  tcp, udp
voice
Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Stars: ✭ 310 (+1247.83%)
Mutual labels:  tcp, udp
socket
Dazzle Async Socket
Stars: ✭ 19 (-17.39%)
Mutual labels:  tcp, udp
chat-server-release
[飞享]-服务端发布版本,支持TCP,Websocket链接,只需修改少量的配置即可快速部署,请严格按照项目部署目录配置环境,这样能保证你快速部署成功.详情请进入官网https://www.fsharechat.cn 查看具体的部署说明,技术支持商业合作请找官方技术支持
Stars: ✭ 28 (+21.74%)
Mutual labels:  tcp, im
masscanned
Let's be scanned. A low-interaction honeypot focused on network scanners and bots. It integrates very well with IVRE to build a self-hosted alternative to GreyNoise.
Stars: ✭ 50 (+117.39%)
Mutual labels:  tcp, udp
hev-socks5-tproxy
A simple, lightweight socks5 transparent proxy for Linux. (IPv4/IPv6/TCP/UDP over TCP)
Stars: ✭ 209 (+808.7%)
Mutual labels:  tcp, udp
reverse-tunnel
Reverse tunnel TCP and UDP
Stars: ✭ 100 (+334.78%)
Mutual labels:  tcp, udp
ctsTraffic
ctsTraffic is a highly scalable client/server networking tool giving detailed performance and reliability analytics
Stars: ✭ 125 (+443.48%)
Mutual labels:  tcp, udp
node-dns
🌐 DNS Server and Client Implementation in Pure JavaScript with no dependencies.
Stars: ✭ 390 (+1595.65%)
Mutual labels:  tcp, udp
KingNetwork
KingNetwork is an open source library to facilitate the creation and communication of clients and servers via TCP, UDP, WebSocket and RUDP sockets.
Stars: ✭ 78 (+239.13%)
Mutual labels:  tcp, udp
RRQMSocket
TouchSocket是.Net(包括 C# 、VB.Net、F#)的一个整合性的、超轻量级的网络通信框架。包含了 tcp、udp、ssl、http、websocket、rpc、jsonrpc、webapi、xmlrpc等一系列的通信模块。一键式解决 TCP 黏分包问题,udp大数据包分片组合问题等。使用协议模板,可快速实现「固定包头」、「固定长度」、「区间字符」等一系列的数据报文解析。
Stars: ✭ 286 (+1143.48%)
Mutual labels:  tcp, udp
Socket
The Hoa\Socket library.
Stars: ✭ 61 (+165.22%)
Mutual labels:  tcp, udp
SACK
System Abstraction Component Kit
Stars: ✭ 18 (-21.74%)
Mutual labels:  tcp, udp
network
exomia/network is a wrapper library around System.Socket for easy and fast TCP/UDP client & server communication.
Stars: ✭ 18 (-21.74%)
Mutual labels:  tcp, udp
go-im
基于Golang编写的高性能im服务器 🚀
Stars: ✭ 220 (+856.52%)
Mutual labels:  tcp, im
fastim
🚀基于Netty高可用分布式即时通讯系统,支持长连接网关管理、单聊、群聊、离线消息、消息推送消息、消息已读未读、消息未读数、红包、消息漫游等功能,支持集群部署的分布式架构。
Stars: ✭ 111 (+382.61%)
Mutual labels:  tcp, im

欢迎阅读Rmessage文档

技术栈

Rmessage是采用Reactor3,基于reactor-netty项目构建的实时消息推送api。

  • 什么是Reactor3?

    Reactor 是一个用于JVM的完全非阻塞的响应式编程框架,具备高效的需求管理(即对 “背压(backpressure)”的控制)能力。它与 Java 8 函数式 API 直接集成,比如 CompletableFuture, Stream, 以及 Duration。它提供了异步序列 API Flux(用于[N]个元素)和 Mono(用于 [0|1]个元素),并完全遵循和实现了“响应式扩展规范”(Reactive Extensions Specification)。

  • 使用Reactor好处?

    非常容易构建高吞吐量纯异步的代码,还有就是能够无缝整合spring5[webflux]项目。

项目简介

使用Rmessage你需要外部管理群组用户关系,以及离线消息存储,Rmessage不提供持久化,测试可以使用默认Handler内存保留离线消息。 整个项目采用纯异步的编程思想去开发,旨在学习reactive programming。

目前支持的功能

  1. 单聊
  2. 群聊
  3. 离线消息落地以及拉取
  4. 离线在线通知管理
  5. 心跳,连接鉴权机制
  6. 群组关系管理
  7. 支持多端在线
  8. 目前支持tcp协议,项目设计时考虑多协议扩展。
  9. 支持服务端自定义消息拦截
  10. 消息QOS机制(还未实现)

快速开始

  • 服务端
Rmessage不管理用户群组之间关系,通过接口暴漏外部,只要实现接口注入即可。
ServerStart
   .builder()
   .tcp()
   .ip("127.0.0.1")
   .port(1888)
   .onReadIdle(10000l) //设置读心跳时间
   .onWriteIdle(10000l) //设置写心跳时间
   .option(ChannelOption.SO_RCVBUF,1023)
   .interceptor(frame -> frame,frame -> frame)// 拦截所有message
   .setAfterChannelInit(channel -> {//  channel设置
      })
   .connect()
   .cast(TcpServerSession.class)
   .subscribe(session->{
                    session.addGroupHandler(groupId -> null).subscribe();
                    session.addOfflineHandler(new DefaultOffMessageHandler()).subscribe();
                    session.addUserHandler(new DefaultUserTransportHandler());
  });

具体接口方法定义请参照接口注释

  1. UserHandler接口是处理用户登陆校验等
  2. OfflineHandler 是处理离线消息存储,以及拉取离线消息的接口
  3. GroupHandler 是获取群组下所有用户的接口
  • 客户端
 ClientStart
     .builder()
     .tcp()
     .ip("127.0.0.1")
     .port(1888)
     .userId("21344")  //设置用户名
     .password("12312") //设置密码
     .onReadIdle(10000l,()->()->System.out.println("心跳了"))//设置读心跳,以及设置回调runner
     .setClientType(ClientType.Ios)//设置客户端类型
     .setAfterChannelInit(channel -> {
                    //  channel设置
      })
     .connect()
     .cast(TcpClientSession.class)
     .subscribe(session->{
      session.sendPoint("123","测试一下哦").subscribe(); //发送单聊消息
                    session.sendGroup("group1","123").subscribe();  // 发送群聊消息
                    session.accept(message -> {
    }); // 接受所有消息
  });

协议设计

  • 单聊 多聊

FixHeader 【1 byte】

client_type message_type
high 4bit low 4bit

Topic 【n byte】

from length to length from to
1byte 1byte n byte n byte

Body 【n byte】

body length body
2 byte n byte
timstamp
8 byte
  • Online报文

FixHeader 【1 byte】

client_type message_type
high 4bit low 4bit

ConnectionState 【n byte】

user length password length user password
1byte 1byte n byte n byte
  • Offline报文

FixHeader 【1 byte】

client_type message_type
high 4bit low 4bit

ConnectionState 【n byte】

user length user
1byte n byte
  • Ping报文/Pong报文

FixHeader 【1 byte】

client_type message_type
high 4bit low 4bit
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].