{"id":41812714,"url":"https://github.com/babex-group/babex","last_synced_at":"2026-01-25T07:07:01.551Z","repository":{"id":57480880,"uuid":"130224276","full_name":"babex-group/babex","owner":"babex-group","description":"Babex is a modern solution for communications between microservices","archived":false,"fork":false,"pushed_at":"2019-06-19T10:57:37.000Z","size":618,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T12:11:32.442Z","etag":null,"topics":["chains","go","kafka","microservices","rabbitmq"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/matroskin13/babex","language":"Go","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/babex-group.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}},"created_at":"2018-04-19T14:01:16.000Z","updated_at":"2020-08-24T10:20:23.000Z","dependencies_parsed_at":"2022-09-26T17:41:22.722Z","dependency_job_id":null,"html_url":"https://github.com/babex-group/babex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/babex-group/babex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babex-group%2Fbabex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babex-group%2Fbabex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babex-group%2Fbabex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babex-group%2Fbabex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babex-group","download_url":"https://codeload.github.com/babex-group/babex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babex-group%2Fbabex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28747308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["chains","go","kafka","microservices","rabbitmq"],"created_at":"2026-01-25T07:07:00.914Z","updated_at":"2026-01-25T07:07:01.543Z","avatar_url":"https://github.com/babex-group.png","language":"Go","readme":"# Babex\n\n[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/matroskin13/babex)\n\nThe Babex allows you to make a chain of microservices on the fly with the help of RabbitMQ, Kafka, etc.\n\n## Docs\n\n- [About the Babex](docs/protocol.md)\n- [Receiving messages](docs/receiving.md)\n- [Middleware](docs/middleware.md)\n- [Examples](https://github.com/babex-group/examples)\n\n## Adapters\n\n- [Kafka](https://github.com/babex-group/babex-kafka)\n- [Rabbit](https://github.com/babex-group/babex-rabbit)\n\n## Usage\n\nFor example, we create service which will add the number to counter. We will use the Kafka adapter.\n\n```go\npackage main\n\nimport (\n\t\"github.com/babex-group/babex\"\n\t\"github.com/babex-group/babex-kafka\"\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"encoding/json\"\n)\n\nfunc main() {\n\ta, err := kafka.NewAdapter(kafka.Options{\n\t\tName:   \"babex-sandbox\"\n\t\tTopics: []string{\"example-topic\"},\n\t\tAddrs:  []string{\"localhost:29092\"},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ts := babex.NewService(a)\n\n\tdefer s.Close()\n\n\ts.Handler(\"example-topic\", \"\", func(msg *babex.Message) error {\n\t\tvar data struct{\n\t\t\tCount int `json:\"count\"`\n\t\t}\n\n\t\tif err := json.Unmarshal(msg.Data, \u0026data); err != nil {\n\t\t\tmsg.Ack() // The message has invalid format, skip it.\n\t\t\treturn err\n\t\t}\n\n\t\tdata.Count += 1\n\n\t\tfmt.Printf(\"count = %v\\r\\n\", data.Count)\n\n\t\treturn s.Next(msg, data, nil) // Next automatically use msg.Ack()\n\t})\n\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, os.Interrupt)\n\n\t\u003c- signals\n}\n```\n\nAnd publish the message to the topic \"babex-sandbox\":\n\n```json\n{\n  \"data\": {\n    \"count\": 0\n  },\n  \"chain\": [\n    {\n      \"exchange\": \"example-topic\"\n    }\n  ]\n}\n```\n\nCheck logs:\n\n```bash\n$ count = 1\n```\n\nExcellent! Let's change the message:\n\n```json\n{\n  \"data\": {\n    \"count\": 0\n  },\n  \"chain\": [\n    {\n      \"exchange\": \"example-topic\"\n    },\n    {\n      \"exchange\": \"example-topic\"\n    }\n  ]\n}\n```\n\nCheck logs:\n\n```bash\n$ count = 1\n$ count = 2\n```\n\nThe service receive two message via chain, and increment the count.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabex-group%2Fbabex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabex-group%2Fbabex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabex-group%2Fbabex/lists"}