{"id":20986627,"url":"https://github.com/dpwgc/serena","last_synced_at":"2026-01-05T14:32:34.341Z","repository":{"id":144485557,"uuid":"445578961","full_name":"dpwgc/serena","owner":"dpwgc","description":"基于Go + Gossip的分布式消息队列服务发现与注册中心","archived":false,"fork":false,"pushed_at":"2022-02-10T14:21:41.000Z","size":57,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T18:28:43.938Z","etag":null,"topics":["cluster","gin","golang","gossip","message-queue","registry","server"],"latest_commit_sha":null,"homepage":"https://github.com/dpwgc/kapokmq","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpwgc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-07T16:10:26.000Z","updated_at":"2022-09-30T03:22:26.000Z","dependencies_parsed_at":"2023-07-23T02:01:57.040Z","dependency_job_id":null,"html_url":"https://github.com/dpwgc/serena","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/dpwgc%2Fserena","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fserena/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fserena/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fserena/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpwgc","download_url":"https://codeload.github.com/dpwgc/serena/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245276883,"owners_count":20589048,"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":["cluster","gin","golang","gossip","message-queue","registry","server"],"created_at":"2024-11-19T06:14:23.565Z","updated_at":"2026-01-05T14:32:34.301Z","avatar_url":"https://github.com/dpwgc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serena\n\n## 基于Go + Gossip的KapokMQ集群服务发现与注册中心\n\n![Go](https://img.shields.io/static/v1?label=LICENSE\u0026message=Apache-2.0\u0026color=orange)\n![Go](https://img.shields.io/static/v1?label=Go\u0026message=v1.17\u0026color=blue)\n[![github](https://img.shields.io/static/v1?label=Github\u0026message=kapokmq\u0026color=blue)](https://github.com/dpwgc/kapokmq)\n[![star](https://gitee.com/dpwgc/kapokmq/badge/star.svg?theme=dark)](https://gitee.com/dpwgc/kapokmq/stargazers)\n[![fork](https://gitee.com/dpwgc/kapokmq/badge/fork.svg?theme=dark)](https://gitee.com/dpwgc/kapokmq/members)\n\n#### KapokMQ与Serena应用整合包下载\n\n* https://github.com/dpwgc/kapokmq-server `github`\n\n* https://gitee.com/dpwgc/kapokmq-server `gitee`\n\n#### KapokMQ消息队列源码\n\n* https://github.com/dpwgc/kapokmq `github`\n\n* https://gitee.com/dpwgc/kapokmq `gitee`\n\n***\n\n### 实现功能\n\n* 使用Gossip发现并同步消息队列服务节点信息。\n\n* 消息队列生产者客户端可通过注册中心获取该集群所有消息队列服务节点列表，并与所有消息队列建立WebSocket连接，该生产者将随机选取一个消息队列节点投递消息。\n\n***\n\n### 开放接口\n\n#### 获取所有消息队列节点信息\n\n* 集群生产者通过此接口获取消息队列节点列表，进行负载均衡分配。\n\n\u003e http://127.0.0.1:8031/Registry/GetNodes\n\n#### 请求方式\n\u003e POST\n\n#### Content-Type\n\u003e form-data\n\n#### 请求Header参数\n\n| 参数        | 示例值   | 是否必填   |  参数描述  |\n| :--------   | :-----  | :-----  | :----  |\n| secretKey     | test |  必填 | 安全访问密钥 |\n\n#### 成功响应\n\n```json\n[\n\t{\n\t\t\"Name\": \"mq:123.123.123.111:8011\",\n\t\t\"Addr\": \"123.123.123.111\",\n\t\t\"Port\": \"8011\"\n\t},\n\t{\n\t\t\"Name\": \"mq:123.123.123.222:8011\",\n\t\t\"Addr\": \"123.123.123.222\",\n\t\t\"Port\": \"8011\"\n\t}\n]\n```\n\n***\n\n### 打包方法\n\n##### 安装并配置go环境\n\n##### 应用打包：\n\n* 使用build.bat一键打包\n\n```\nWindows系统下直接运行./build.bat文件\n自动执行打包命令\n生成Linux二进制文件与Windows exe文件\n```\n\n* 打包成windows exe\n\n```\n  GoLand终端cd到项目根目录，执行go build命令，生成exe文件\n```\n\n* 打包成linux二进制文件\n\n```\n  cmd终端cd到项目根目录，依次执行下列命令：\n  SET CGO_ENABLED=0\n  SET GOOS=linux\n  SET GOARCH=amd64\n  go build\n  生成二进制执行文件\n```\n\n***\n\n### 部署方法\n\n* 在服务器上部署\n\n```\n在Windows上部署\n\n/serena                   # 文件根目录\n    serena.exe            # 打包后的exe文件\n    application.yaml      # 配置文件\n    /log                  # 日志目录\n```\n\n```\n在Linux上部署\n\n/serena                   # 文件根目录\n    serena                # 打包后的二进制文件(程序后台执行:setsid ./serena)\n    application.yaml      # 配置文件\n    /log                  # 日志目录\n```\n\n***\n\n### 主要模块\n\n##### 创建Gossip集群 `server/server.go`\n\n* 使用 github.com/hashicorp/memberlist 创建一个Gossip集群的初始节点（注册中心节点），所有消息队列节点都要与注册中心节点相连。\n\n* 对外给出一个GetNodes（http post接口），集群生产者将通过此接口获取消息队列节点列表。\n\n***\n\n### 配置文件\n\n* ./application.yaml\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpwgc%2Fserena","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpwgc%2Fserena","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpwgc%2Fserena/lists"}