{"id":43238138,"url":"https://github.com/mehdieidi/pubsub","last_synced_at":"2026-02-01T11:12:44.561Z","repository":{"id":64305599,"uuid":"476457035","full_name":"mehdieidi/pubsub","owner":"mehdieidi","description":"Distributed Many-to-Many pub sub service.","archived":false,"fork":false,"pushed_at":"2022-04-08T14:19:03.000Z","size":48,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T07:53:27.724Z","etag":null,"topics":["go","golang","message-broker","publisher-subscriber","pubsub"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehdieidi.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":"2022-03-31T19:53:15.000Z","updated_at":"2023-06-09T09:26:43.000Z","dependencies_parsed_at":"2023-01-15T10:30:33.802Z","dependency_job_id":null,"html_url":"https://github.com/mehdieidi/pubsub","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mehdieidi/pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdieidi%2Fpubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdieidi%2Fpubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdieidi%2Fpubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdieidi%2Fpubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehdieidi","download_url":"https://codeload.github.com/mehdieidi/pubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehdieidi%2Fpubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28977317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T09:57:52.632Z","status":"ssl_error","status_checked_at":"2026-02-01T09:57:49.143Z","response_time":56,"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":["go","golang","message-broker","publisher-subscriber","pubsub"],"created_at":"2026-02-01T11:12:44.275Z","updated_at":"2026-02-01T11:12:44.556Z","avatar_url":"https://github.com/mehdieidi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubsub\nDistributed Many-to-Many pub sub service.\n\nThe broker is a server which handles the publish and subscribe functionalities.\n\nTo start the broker server:\n```\n$ cd pubsub/cmd\ngo run .\n```\n\n## Subscriber clients\n\nSubscriber clients must have an HTTP address so the broker server can send messages back to this address.\n\nSubscriber clients need to introduce themselves to the broker server and subscribe for topics.\n\nCreate new subscriber client and marshall. Example: \n```\ns := subscriber.New(\"http://localhost:8081\", []string{\"football\", \"volleyball\", \"handball\"}, true)\nj, _ := json.Marshal(s)\n```\n\nClients should start listening before introducing themselves to the server. (In a separate goroutine).\u003cbr\u003e\nThe s.Listen() will populate the msg variable when received data.\n```\nvar msg message.Message\ngo s.Listen(\u0026msg)\n```\n\nRegister with the server and subscribe for the defined topics:\n```\nhttp.Post(\"http://localhost:8080/subscribe\", \"application/json\", bytes.NewBuffer(j))\n```\n\nThe s.Listen method will handle the incoming messages from the broker server.\n\n## Publishing messages\n\n\nFor publishing messages, publishers only need to send a POST request with the defined json structure to the broker server:\n```\n// send post request with this json structure to the /publish endpoint:\n{\n\t\"topic\": \"handball\",\n\t\"body\": \"a sample message\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdieidi%2Fpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehdieidi%2Fpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdieidi%2Fpubsub/lists"}