{"id":36419836,"url":"https://github.com/taniqng/dis-eventbus","last_synced_at":"2026-01-11T17:05:27.864Z","repository":{"id":57723498,"uuid":"113017391","full_name":"taniqng/dis-eventbus","owner":"taniqng","description":"Simple distributed event-bus based on Spring AMQP","archived":false,"fork":false,"pushed_at":"2018-05-08T09:00:35.000Z","size":61,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T09:23:34.223Z","etag":null,"topics":["distributed","eventbus","java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/taniqng.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}},"created_at":"2017-12-04T08:42:37.000Z","updated_at":"2024-02-10T15:16:28.000Z","dependencies_parsed_at":"2022-08-28T15:34:10.553Z","dependency_job_id":null,"html_url":"https://github.com/taniqng/dis-eventbus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taniqng/dis-eventbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniqng%2Fdis-eventbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniqng%2Fdis-eventbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniqng%2Fdis-eventbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniqng%2Fdis-eventbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taniqng","download_url":"https://codeload.github.com/taniqng/dis-eventbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniqng%2Fdis-eventbus/sbom","scorecard":{"id":867971,"data":{"date":"2025-08-11","repo":{"name":"github.com/taniqng/dis-eventbus","commit":"5e37016c0a5e50b6ef4c015443e0954ac904ccf7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"85 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-4gq5-ch57-c2mg","Warn: Project is vulnerable to: GHSA-4w82-r329-3q67","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-5949-rw7g-wx7w","Warn: Project is vulnerable to: GHSA-5r5r-6hpj-8gg9","Warn: Project is vulnerable to: GHSA-5ww9-j83m-q7qx","Warn: Project is vulnerable to: GHSA-645p-88qh-w398","Warn: Project is vulnerable to: GHSA-6fpp-rgj9-8rwc","Warn: Project is vulnerable to: GHSA-6wqp-v4v6-c87c","Warn: Project is vulnerable to: GHSA-85cw-hj65-qqv9","Warn: Project is vulnerable to: GHSA-89qr-369f-5m5x","Warn: Project is vulnerable to: GHSA-8c4j-34r4-xr8g","Warn: Project is vulnerable to: GHSA-8w26-6f25-cm9x","Warn: Project is vulnerable to: GHSA-9gph-22xh-8x98","Warn: Project is vulnerable to: GHSA-9m6f-7xcq-8vf8","Warn: Project is vulnerable to: GHSA-9mxf-g3x6-wv74","Warn: Project is vulnerable to: GHSA-c8hm-7hpq-7jhg","Warn: Project is vulnerable to: GHSA-cf6r-3wgc-h863","Warn: Project is vulnerable to: GHSA-cggj-fvv3-cqwv","Warn: Project is vulnerable to: GHSA-cjjf-94ff-43w7","Warn: Project is vulnerable to: GHSA-cmfg-87vq-g5g4","Warn: Project is vulnerable to: GHSA-cvm9-fjm9-3572","Warn: Project is vulnerable to: GHSA-f3j5-rmmp-3fc5","Warn: Project is vulnerable to: GHSA-f9hv-mg5h-xcw9","Warn: Project is vulnerable to: GHSA-f9xh-2qgp-cq57","Warn: Project is vulnerable to: GHSA-fmmc-742q-jg75","Warn: Project is vulnerable to: GHSA-fqwf-pjwf-7vqv","Warn: Project is vulnerable to: GHSA-gjmw-vf9h-g25v","Warn: Project is vulnerable to: GHSA-gwp4-hfv6-p7hw","Warn: Project is vulnerable to: GHSA-gww7-p5w4-wrfv","Warn: Project is vulnerable to: GHSA-h3cw-g4mq-c5x2","Warn: Project is vulnerable to: GHSA-h592-38cm-4ggp","Warn: Project is vulnerable to: GHSA-h822-r4r5-v8jg","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-m6x4-97wx-4q27","Warn: Project is vulnerable to: GHSA-mph4-vhrx-mv67","Warn: Project is vulnerable to: GHSA-mx7p-6679-8g3q","Warn: Project is vulnerable to: GHSA-mx9v-gmh4-mgqw","Warn: Project is vulnerable to: GHSA-p43x-xfjf-5jhr","Warn: Project is vulnerable to: GHSA-q93h-jc49-78gg","Warn: Project is vulnerable to: GHSA-qjw2-hr98-qgfh","Warn: Project is vulnerable to: GHSA-qr7j-h6gg-jmgc","Warn: Project is vulnerable to: GHSA-r3gr-cxrf-hg25","Warn: Project is vulnerable to: GHSA-r695-7vr9-jgc2","Warn: Project is vulnerable to: GHSA-rfx6-vp9g-rh7v","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-rpr3-cw39-3pxh","Warn: Project is vulnerable to: GHSA-v585-23hc-c647","Warn: Project is vulnerable to: GHSA-vfqx-33qm-g869","Warn: Project is vulnerable to: GHSA-w3f4-3q6j-rh82","Warn: Project is vulnerable to: GHSA-wh8g-3j2c-rqj5","Warn: Project is vulnerable to: GHSA-x2w5-5m2g-7h5m","Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-mm8h-8587-p46h","Warn: Project is vulnerable to: GHSA-w4g2-9hj6-5472","Warn: Project is vulnerable to: GHSA-7r82-7xv7-xcpj","Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","Warn: Project is vulnerable to: GHSA-hh26-6xwr-ggv7","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-g5mm-vmx4-3rg7","Warn: Project is vulnerable to: GHSA-4487-x383-qpph","Warn: Project is vulnerable to: GHSA-f26x-pr96-vw86","Warn: Project is vulnerable to: GHSA-ffvq-7w96-97p7","Warn: Project is vulnerable to: GHSA-g8hw-794c-4j9g","Warn: Project is vulnerable to: GHSA-rcpf-vj53-7h2m","Warn: Project is vulnerable to: GHSA-v596-fwhq-8x48","Warn: Project is vulnerable to: GHSA-558x-2xjg-6232","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8","Warn: Project is vulnerable to: GHSA-3rmv-2pg5-xvqj","Warn: Project is vulnerable to: GHSA-p5hg-3xm3-gcjg","Warn: Project is vulnerable to: GHSA-rqph-vqwm-22vc","Warn: Project is vulnerable to: GHSA-2rmj-mq67-h97g","Warn: Project is vulnerable to: GHSA-2wrp-6fg6-hmc5","Warn: Project is vulnerable to: GHSA-4wrc-f8pq-fpqp","Warn: Project is vulnerable to: GHSA-9gcm-f4x3-8jpw","Warn: Project is vulnerable to: GHSA-ccgv-vj62-xf9h","Warn: Project is vulnerable to: GHSA-hgjh-9rj2-g67j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T03:16:05.901Z","repository_id":57723498,"created_at":"2025-08-24T03:16:05.901Z","updated_at":"2025-08-24T03:16:05.901Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28314264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["distributed","eventbus","java"],"created_at":"2026-01-11T17:05:27.025Z","updated_at":"2026-01-11T17:05:27.858Z","avatar_url":"https://github.com/taniqng.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dis-eventbus\r\nSimple distributed event-bus \r\nbased on：\r\n* spring boot\r\n* rabbitMQ\r\n* google guava\r\n\r\n## 目标：\r\n* 实现一个分布式事件总线。\r\n* 最大限度的方便开发者使用监听者模式构建低耦合、易于扩展的应用程序。\r\n* 能够使用注解发布事件等一系列高效编程方式。\r\n\r\n\r\n## 环境\r\n\r\n- Maven 3\r\n- Java 8\r\n\r\n## maven依赖\r\n\r\n```\r\n\t\t\r\n\t\t\u003cdependency\u003e\r\n\t\t\t\u003cgroupId\u003ecom.github.taniqng\u003c/groupId\u003e\r\n\t\t\t\u003cartifactId\u003edis-eventbus-api\u003c/artifactId\u003e\r\n\t\t\t\u003cversion\u003e1.0.6\u003c/version\u003e\r\n\t\t\u003c/dependency\u003e\r\n\t\t\r\n\t\t\u003cdependency\u003e\r\n\t\t\t\u003cgroupId\u003ecom.github.taniqng\u003c/groupId\u003e\r\n\t\t\t\u003cartifactId\u003edis-eventbus-core\u003c/artifactId\u003e\r\n\t\t\t\u003cversion\u003e1.0.6\u003c/version\u003e\r\n\t\t\u003c/dependency\u003e\r\n```\r\n## 定义你的事件\r\n\r\n```\r\n\t/**\r\n\t * 定义一个发表文章事件\r\n\t */\r\n\tpublic class SendPostEvent extends DisEvent\u003cPostInfo\u003e{\r\n\r\n\t\tprivate static final long serialVersionUID = -138646642993478976L;\r\n\r\n\t}\r\n\r\n```\r\n\r\n## 基于注解的事件发布\r\n\r\n```\r\n\t/**\r\n\t * 保存文章\r\n\t */\t\r\n\t@RequestMapping(value = \"/posts\", method = RequestMethod.POST)\r\n\t@SendEvent(SendPostEvent.class)\r\n\tpublic PostInfo savePost(@Valid @NotNull @RequestBody PostInfo post) {\r\n\t\t//你的业务代码\r\n\t\t//返回文章对象, 该对象作为事件发布的data, 可以被事件监听者接收。\r\n\t}\r\n\r\n```\r\n\r\n## 手动发布(以下和基于注解的方式等价,合理布局代码可以避免手动发布)\r\n\r\n```\r\n\t@Autowired DisEventBus bus;\r\n\t\r\n\t@RequestMapping(value = \"/posts\", method = RequestMethod.POST)\r\n\tpublic PostInfo savePost(@Valid @NotNull @RequestBody PostInfo post) {\r\n\t\t//你的业务代码\r\n\t\tbus.publishEvent(SendPostEvent.class, post);\r\n\t}\r\n\r\n```\r\n\r\n\r\n## 事件监听器\r\n\r\n```\r\n/**\r\n * 监听PostInfo的变化，同步更新Elasticsearch。\u003cbr\u003e\r\n * 这里可以考虑使用缓冲队列，然后bulk操作来批量处理，后期优化。\u003cbr\u003e\r\n * \r\n * \u003cp\u003e\r\n *  注：对单机而言这个操作于主业务来说是异步的。对分布式环境更是会选择最空闲的节点来执行。\u003cbr\u003e\r\n *      所以注意使用合适的锁来保证对共享资源操作时的同步。\r\n * \u003c/p\u003e\r\n */\r\n@MessageListener\r\npublic class PostInfoListener {\r\n\t\r\n\tprivate Logger logger = LoggerFactory.getLogger(this.getClass());\r\n\t\r\n\t@Autowired\r\n\tSearchService postService;\r\n\t\r\n\t@Subscribe\t\r\n\tpublic void accept(SendPostEvent event){\r\n\t  PostInfo postInfo = event.getData();\t  \r\n\t  //将postInfo保存至ES\r\n\t}\r\n\t\r\n\t@Subscribe\r\n\tpublic void accept(EditPostEvent event){\r\n\t  PostInfo postInfo = event.getData();\t  \r\n\t  //更新ES指定的document\r\n\t}\r\n}\r\n\r\n```\r\n## Q \u0026 A\r\n\u003e Q: 项目中使用activeMQ如何操作？\u003cbr\u003e\r\n\u003e A: dis-eventbus使用spring-boot-starter-amqp, 默认使用rabbitMQ作为Spring AMQP规范（SPI）的provider，只需execlude掉spring-rabbit，实现自己的amqp provider。\r\n\r\n## License\r\ndis-eventbus is Open Source software released under the\r\nhttp://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniqng%2Fdis-eventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaniqng%2Fdis-eventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniqng%2Fdis-eventbus/lists"}