{"id":20040251,"url":"https://github.com/stonyshi/message-channel","last_synced_at":"2025-05-05T08:31:58.177Z","repository":{"id":76047521,"uuid":"173891933","full_name":"StonyShi/message-channel","owner":"StonyShi","description":"message-hub, 消息枢纽中心","archived":false,"fork":false,"pushed_at":"2019-04-21T10:22:10.000Z","size":433,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T19:31:44.575Z","etag":null,"topics":["event-hub","message","message-bus","message-queue-server","push-message"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StonyShi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-05T06:55:24.000Z","updated_at":"2024-08-01T05:59:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a14de56-ae5d-4ff0-8c20-88af0e25ef0b","html_url":"https://github.com/StonyShi/message-channel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StonyShi%2Fmessage-channel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StonyShi%2Fmessage-channel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StonyShi%2Fmessage-channel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StonyShi%2Fmessage-channel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StonyShi","download_url":"https://codeload.github.com/StonyShi/message-channel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466677,"owners_count":21752409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["event-hub","message","message-bus","message-queue-server","push-message"],"created_at":"2024-11-13T10:41:17.610Z","updated_at":"2025-05-05T08:31:58.165Z","avatar_url":"https://github.com/StonyShi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 消息中心 message-channel\n\n## 主要功能\n    1. 消息处理，生产消费\n    2. 聊天会话\n    3. 应用广播、通知推送\n\n## 设计目标\n    1. worker无状态线性扩容\n    2. 消息不落盘中转\n    3. 单机长连接用户200w+\n    4. 单机并发用户30w+\n\n## 架构图\n![架构图](https://github.com/StonyShi/message-channel/blob/master/flows/cluster-flow_jg.png)\n \n    \n## 主要模块\n\n#### Master\n    1. worker注册、发现，平衡worker负载\n    2. 监控worker存活，性能指标\n    3. 聊天会话管理分配\n    \n#### Worker\n    1. 注册、性能指标上报Master \n    2. topic消息转发\n    3. 通知提醒app\n    4. 聊天会话转发\n    \n    \n#### APP\n    1. 生产topic消息\n    2. 聊天会话\n\n\n#### Consumer\n    1. 消防topic消息 \n    2. 广播消息到APP\n    \n## 聊天会话\n    1. app-A发起聊天，在worker注册管理会话信息（id，app-A通道，A-worker地址）\n    2. worker向master注册会话(Id,A-worker地址)\n    3. app-B连接聊天Id，在worker注册\n    4. 先在master查找id，匹配B-worker与发起者是否一致，不一致返回307重定向到A-worker地址\n    \n    \n## 会话流程图\n![会话流程图](https://github.com/StonyShi/message-channel/blob/master/flows/chat-flow.png)\n    \n \n    \n#### 测试代码查看：\n    com.stony.mc.session.WorkerServerTest\n    \n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonyshi%2Fmessage-channel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstonyshi%2Fmessage-channel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstonyshi%2Fmessage-channel/lists"}