{"id":48680746,"url":"https://github.com/Ahoo-Wang/govern-eventbus","last_synced_at":"2026-04-26T20:00:44.324Z","repository":{"id":40357695,"uuid":"253807025","full_name":"Ahoo-Wang/govern-eventbus","owner":"Ahoo-Wang","description":"Govern Service RPC \u0026 Event-Driven Architecture Framework || Govern EventBus is no longer maintained, please use Wow instead.","archived":true,"fork":false,"pushed_at":"2023-06-02T01:16:21.000Z","size":441,"stargazers_count":31,"open_issues_count":11,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T04:36:41.386Z","etag":null,"topics":["compensation","consistency","distributed","eda","event-driven","event-driven-architecture","eventbus","java","kafka","microservice","microservices","mq","publisher","rabbitmq","spring","spring-boot","subscriber"],"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/Ahoo-Wang.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":"2020-04-07T13:49:34.000Z","updated_at":"2024-06-10T03:52:18.000Z","dependencies_parsed_at":"2024-11-16T01:15:21.756Z","dependency_job_id":"6742bf85-8187-484d-bc98-93412f494051","html_url":"https://github.com/Ahoo-Wang/govern-eventbus","commit_stats":null,"previous_names":["ahoo-wang/smarteventbus"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Ahoo-Wang/govern-eventbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2Fgovern-eventbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2Fgovern-eventbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2Fgovern-eventbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2Fgovern-eventbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ahoo-Wang","download_url":"https://codeload.github.com/Ahoo-Wang/govern-eventbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2Fgovern-eventbus/sbom","scorecard":{"id":9506,"data":{"date":"2025-08-11","repo":{"name":"github.com/Ahoo-Wang/govern-eventbus","commit":"343878f2666b50d3a48c15f7fc7217554bb55763"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/20 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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Info: jobLevel 'contents' permission set to 'read': .github/workflows/package-deploy.yml:23","Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/integration-test.yml:1","Warn: no topLevel permission defined: .github/workflows/package-deploy.yml:1","Info: no jobLevel write permissions found"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codecov.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/integration-test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/integration-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/integration-test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/integration-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-deploy.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/package-deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-deploy.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/package-deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-deploy.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/package-deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/package-deploy.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/Ahoo-Wang/govern-eventbus/package-deploy.yml/master?enable=pin","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"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":"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":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T14:15:35.800Z","repository_id":40357695,"created_at":"2025-08-14T14:15:35.800Z","updated_at":"2025-08-14T14:15:35.800Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32310804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"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":["compensation","consistency","distributed","eda","event-driven","event-driven-architecture","eventbus","java","kafka","microservice","microservices","mq","publisher","rabbitmq","spring","spring-boot","subscriber"],"created_at":"2026-04-11T01:00:36.059Z","updated_at":"2026-04-26T20:00:44.315Z","avatar_url":"https://github.com/Ahoo-Wang.png","language":"Java","funding_links":[],"categories":["进程间通信"],"sub_categories":["Spring Cloud框架"],"readme":"# *Govern EventBus* is no longer maintained, please use [*Wow*](https://github.com/Ahoo-Wang/Wow) instead.\n\n\u003e [中文文档](./README.zh-CN.md)\n\n*Govern EventBus* is an *event-driven architecture* framework that has been validated in a four-year production\nenvironment, which governs remote procedure calls between microservices through event bus mechanism. Strong consistency\nwithin microservices is supported by local transactions, and final consistency between microservices is achieved by\nevent bus. In addition, automatic compensation of event publish / subscribe is provided.\n\n## Execution Flow\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./docs/Govern-EventBus.png\" alt=\"Govern EventBus\"/\u003e\u003c/p\u003e\n\n## Installation\n\n### init db\n\n``` sql\n\ncreate table simba_mutex\n(\n    mutex         varchar(66)     not null primary key comment 'mutex name',\n    acquired_at   bigint unsigned not null,\n    ttl_at        bigint unsigned not null,\n    transition_at bigint unsigned not null,\n    owner_id      char(32)        not null,\n    version       int unsigned    not null\n);\n\ncreate table if not exists cosid_machine\n(\n    name            varchar(100) not null comment '{namespace}.{machine_id}',\n    namespace       varchar(100) not null,\n    machine_id      integer      not null default 0,\n    last_timestamp  bigint       not null default 0,\n    instance_id     varchar(100) not null default '',\n    distribute_time bigint       not null default 0,\n    revert_time     bigint       not null default 0,\n    constraint cosid_machine_pk\n        primary key (name)\n) engine = InnoDB;\n\ncreate index if not exists idx_namespace on cosid_machine (namespace);\ncreate index if not exists idx_instance_id on cosid_machine (instance_id);\n\ncreate table publish_event\n(\n    id             bigint unsigned auto_increment\n        primary key,\n    event_name     varchar(100)              not null,\n    event_data_id  bigint unsigned default 0 not null,\n    event_data     mediumtext                not null,\n    status         smallint unsigned         not null,\n    published_time bigint unsigned default 0 not null,\n    version        smallint unsigned         not null,\n    create_time    bigint unsigned           not null\n);\n\ncreate\n    index idx_status\n    on publish_event (status);\n\ncreate table publish_event_compensate\n(\n    id               bigint unsigned auto_increment\n        primary key,\n    publish_event_id bigint unsigned not null,\n    start_time       bigint unsigned not null,\n    taken            bigint unsigned not null,\n    failed_msg       text            null\n);\n\ncreate table publish_event_failed\n(\n    id               bigint unsigned auto_increment\n        primary key,\n    publish_event_id bigint unsigned not null,\n    failed_msg       text            not null,\n    create_time      bigint unsigned not null\n);\n\ncreate table subscribe_event\n(\n    id                bigint unsigned auto_increment\n        primary key,\n    subscribe_name    varchar(100)              not null,\n    status            smallint unsigned         not null,\n    subscribe_time    bigint unsigned           not null,\n    event_id          bigint unsigned           not null,\n    event_name        varchar(100)              not null,\n    event_data_id     bigint unsigned default 0 not null,\n    event_data        mediumtext                not null,\n    event_create_time bigint unsigned           not null,\n    version           smallint unsigned         not null,\n    create_time       bigint unsigned           not null,\n    constraint uk_subscribe_name_even_id_event_name\n        unique (subscribe_name, event_id, event_name)\n);\n\ncreate\n    index idx_status\n    on subscribe_event (status);\n\ncreate table subscribe_event_compensate\n(\n    id                 bigint unsigned auto_increment\n        primary key,\n    subscribe_event_id bigint unsigned not null,\n    start_time         bigint unsigned not null,\n    taken              int unsigned    not null,\n    failed_msg         text            null\n);\n\ncreate table subscribe_event_failed\n(\n    id                 bigint unsigned auto_increment\n        primary key,\n    subscribe_event_id bigint unsigned not null,\n    failed_msg         text            not null,\n    create_time        bigint unsigned not null\n);\n\ninsert into simba_mutex\n    (mutex, acquired_at, ttl_at, transition_at, owner_id, version)\nvalues ('eventbus_publish_leader', 0, 0, 0, '', 0);\n\ninsert into simba_mutex\n    (mutex, acquired_at, ttl_at, transition_at, owner_id, version)\nvalues ('eventbus_subscribe_leader', 0, 0, 0, '', 0);\n\n```\n\n### Gradle\n\n\u003e Kotlin DSL\n\n```kotlin\n    val eventbusVersion = \"1.0.5\";\n    implementation(\"me.ahoo.eventbus:eventbus-spring-boot-starter:${eventbusVersion}\")\n    implementation(\"me.ahoo.eventbus:eventbus-spring-boot-autoconfigure:${eventbusVersion}\") {\n        capabilities {\n            requireCapability(\"me.ahoo.eventbus:rabbit-bus-support\")\n            //requireCapability(\"me.ahoo.eventbus:kafka-bus-support\")\n        }\n    }\n```\n\n### Maven\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n    \u003cartifactId\u003edemo\u003c/artifactId\u003e\n    \u003cproperties\u003e\n        \u003ceventbus.version\u003e1.0.5\u003c/eventbus.version\u003e\n    \u003c/properties\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eme.ahoo.eventbus\u003c/groupId\u003e\n            \u003cartifactId\u003eeventbus-spring-boot-starter\u003c/artifactId\u003e\n            \u003cversion\u003e${eventbus.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eme.ahoo.eventbus\u003c/groupId\u003e\n            \u003cartifactId\u003eeventbus-rabbit\u003c/artifactId\u003e\n            \u003cversion\u003e${eventbus.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003c!--\u003cdependency\u003e--\u003e\n        \u003c!--    \u003cgroupId\u003eme.ahoo.eventbus\u003c/groupId\u003e--\u003e\n        \u003c!--    \u003cartifactId\u003eeventbus-kafka\u003c/artifactId\u003e--\u003e\n        \u003c!--    \u003cversion\u003e${eventbus.version}\u003c/version\u003e--\u003e\n        \u003c!--\u003c/dependency\u003e--\u003e\n    \u003c/dependencies\u003e\n\u003c/project\u003e\n```\n\n### Spring Boot Application Config\n\n```yaml\nspring:\n  application:\n    name: eventbus-demo\n  rabbitmq:\n    host: localhost\n    username: eventbus\n    password: eventbus\n\n  shardingsphere:\n    datasource:\n      names: ds0\n      ds0:\n        type: com.zaxxer.hikari.HikariDataSource\n        jdbcUrl: jdbc:mariadb://localhost:3306/eventbus_db?serverTimezone=GMT%2B8\u0026characterEncoding=utf-8\n        username: root\n        password: root\n    props:\n      sql-show: true\n    rules:\n      sharding:\n        tables:\n          publish_event:\n            actual-data-nodes: ds0.publish_event_$-\u003e{202110..202112},ds0.publish_event_$-\u003e{202201..202212}\n            table-strategy:\n              standard:\n                sharding-column: create_time\n                sharding-algorithm-name: publish-event-interval\n          subscribe_event:\n            actual-data-nodes: ds0.subscribe_event_$-\u003e{202110..202112},ds0.subscribe_event_$-\u003e{202201..202212}\n            table-strategy:\n              standard:\n                sharding-column: event_create_time\n                sharding-algorithm-name: subscribe-event-interval\n        sharding-algorithms:\n          publish-event-interval:\n            type: COSID_INTERVAL\n            props:\n              logic-name-prefix: publish_event_\n              datetime-lower: 2021-10-01 00:00:00\n              datetime-upper: 2022-12-31 23:59:59\n              sharding-suffix-pattern: yyyyMM\n              datetime-interval-unit: MONTHS\n              datetime-interval-amount: 1\n          subscribe-event-interval:\n            type: COSID_INTERVAL\n            props:\n              logic-name-prefix: subscribe_event_\n              datetime-lower: 2021-10-01 00:00:00\n              datetime-upper: 2022-12-31 23:59:59\n              sharding-suffix-pattern: yyyyMM\n              datetime-interval-unit: MONTHS\n              datetime-interval-amount: 1\ngovern:\n  eventbus:\n    rabbit:\n      exchange: eventbus\n    compensate:\n      publish:\n        schedule:\n          initial-delay: 30s\n          period: 10s\n        range: 60D\n      subscribe:\n        schedule:\n          initial-delay: 30s\n          period: 10s\n      enabled: true\n    subscriber:\n      prefix: ${spring.application.name}.\n\ncosid:\n  namespace: ${spring.application.name}\n  segment:\n    enabled: true\n    mode: chain\n    chain:\n      safe-distance: 1\n    distributor:\n      jdbc:\n        enable-auto-init-id-segment: true\n    provider:\n      eventbus:\n        step: 100\n```\n\n## Get Started\n\n\u003e Generally, the *publisher* and the *subscriber* are not in the same application service.\n\u003e This is just for demonstration purposes.。\n\n\u003e [Demo](./eventbus-demo)\n\n### Publisher\n\n```java\n/**\n * Define publishing events\n */\npublic class OrderCreatedEvent {\n    private long orderId;\n\n    public long getOrderId() {\n        return orderId;\n    }\n\n    public void setOrderId(long orderId) {\n        this.orderId = orderId;\n    }\n\n    @Override\n    public String toString() {\n        return \"OrderCreatedEvent{\" +\n                \"orderId=\" + orderId +\n                \"}\";\n    }\n}\n```\n\n```java\npackage me.ahoo.eventbus.demo.service;\n\nimport me.ahoo.eventbus.core.annotation.Publish;\nimport me.ahoo.eventbus.demo.event.OrderCreatedEvent;\nimport org.springframework.stereotype.Service;\n\n/**\n * @author ahoo wang\n */\n@Service\npublic class OrderService {\n\n    @Publish\n    public OrderCreatedEvent createOrder() {\n        OrderCreatedEvent orderCreatedEvent = new OrderCreatedEvent();\n        orderCreatedEvent.setOrderId(1L);\n        return orderCreatedEvent;\n    }\n}\n\n```\n\n### Subscriber\n\n```java\npackage me.ahoo.eventbus.demo.service;\n\nimport lombok.extern.slf4j.Slf4j;\nimport me.ahoo.eventbus.core.annotation.Subscribe;\nimport me.ahoo.eventbus.demo.event.OrderCreatedEvent;\nimport org.springframework.stereotype.Service;\n\n@Slf4j\n@Service\npublic class NoticeService {\n\n    @Subscribe\n    public void handleOrderCreated(OrderCreatedEvent orderCreatedEvent) {\n        log.info(\"handleOrderCreated - event:[{}].\", orderCreatedEvent);\n        /**\n         * Execute business code\n         * send sms / email ?\n         */\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhoo-Wang%2Fgovern-eventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAhoo-Wang%2Fgovern-eventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhoo-Wang%2Fgovern-eventbus/lists"}