https://github.com/stonyshi/message-channel
message-hub, 消息枢纽中心
https://github.com/stonyshi/message-channel
event-hub message message-bus message-queue-server push-message
Last synced: about 1 year ago
JSON representation
message-hub, 消息枢纽中心
- Host: GitHub
- URL: https://github.com/stonyshi/message-channel
- Owner: StonyShi
- Created: 2019-03-05T06:55:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-21T10:22:10.000Z (about 7 years ago)
- Last Synced: 2025-04-08T19:31:44.575Z (about 1 year ago)
- Topics: event-hub, message, message-bus, message-queue-server, push-message
- Language: Java
- Homepage:
- Size: 423 KB
- Stars: 13
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 消息中心 message-channel
## 主要功能
1. 消息处理,生产消费
2. 聊天会话
3. 应用广播、通知推送
## 设计目标
1. worker无状态线性扩容
2. 消息不落盘中转
3. 单机长连接用户200w+
4. 单机并发用户30w+
## 架构图

## 主要模块
#### Master
1. worker注册、发现,平衡worker负载
2. 监控worker存活,性能指标
3. 聊天会话管理分配
#### Worker
1. 注册、性能指标上报Master
2. topic消息转发
3. 通知提醒app
4. 聊天会话转发
#### APP
1. 生产topic消息
2. 聊天会话
#### Consumer
1. 消防topic消息
2. 广播消息到APP
## 聊天会话
1. app-A发起聊天,在worker注册管理会话信息(id,app-A通道,A-worker地址)
2. worker向master注册会话(Id,A-worker地址)
3. app-B连接聊天Id,在worker注册
4. 先在master查找id,匹配B-worker与发起者是否一致,不一致返回307重定向到A-worker地址
## 会话流程图

#### 测试代码查看:
com.stony.mc.session.WorkerServerTest