{"id":14987737,"url":"https://github.com/apache/pulsar-client-go","last_synced_at":"2025-05-13T00:11:12.584Z","repository":{"id":37848983,"uuid":"185278617","full_name":"apache/pulsar-client-go","owner":"apache","description":"Apache Pulsar Go Client Library","archived":false,"fork":false,"pushed_at":"2025-05-09T03:26:22.000Z","size":3575,"stargazers_count":695,"open_issues_count":243,"forks_count":350,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-05-10T17:16:40.879Z","etag":null,"topics":["event-streaming","go","golang","messaging","pubsub","pulsar","queuing","streaming"],"latest_commit_sha":null,"homepage":"https://pulsar.apache.org/","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/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2019-05-06T22:08:46.000Z","updated_at":"2025-05-09T03:26:26.000Z","dependencies_parsed_at":"2023-02-12T10:15:49.147Z","dependency_job_id":"c485d58c-7d46-4a8d-ae14-0b2684a35aba","html_url":"https://github.com/apache/pulsar-client-go","commit_stats":{"total_commits":891,"total_committers":159,"mean_commits":5.60377358490566,"dds":0.8810325476992144,"last_synced_commit":"188dba9b64d3072fa662e28f6bf869735e6fbc50"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fpulsar-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/pulsar-client-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843216,"owners_count":21972874,"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":["event-streaming","go","golang","messaging","pubsub","pulsar","queuing","streaming"],"created_at":"2024-09-24T14:15:18.096Z","updated_at":"2025-05-13T00:11:12.554Z","avatar_url":"https://github.com/apache.png","language":"Go","readme":"\u003c!--\n\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n\n--\u003e\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/apache/pulsar-client-go)](https://pkg.go.dev/github.com/apache/pulsar-client-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/apache/pulsar-client-go)](https://goreportcard.com/report/github.com/apache/pulsar-client-go)\n[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/)\n[![LICENSE](https://img.shields.io/hexpm/l/pulsar.svg)](https://github.com/apache/pulsar-client-go/blob/master/LICENSE)\n\n# Apache Pulsar Go Client Library\n\nA Go client library for [Apache Pulsar](https://pulsar.apache.org/). For the supported Pulsar features, see [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/).\n\n## Purpose\n\nThis project is a pure-Go client library for Pulsar that does not\ndepend on the C++ Pulsar library.\n\nOnce feature parity and stability are reached, this will supersede the current\nCGo-based library.\n\n## Requirements\n\n- Go 1.23+\n\n## Status\n\nCheck the Projects page at https://github.com/apache/pulsar-client-go/projects for\ntracking the status and the progress.\n\n## Usage\n\nImport the client library:\n\n```go\nimport \"github.com/apache/pulsar-client-go/pulsar\"\n```\n\nCreate a Producer:\n\n```go\nclient, err := pulsar.NewClient(pulsar.ClientOptions{\n    URL: \"pulsar://localhost:6650\",\n})\n\ndefer client.Close()\n\nproducer, err := client.CreateProducer(pulsar.ProducerOptions{\n\tTopic: \"my-topic\",\n})\n\n_, err = producer.Send(context.Background(), \u0026pulsar.ProducerMessage{\n\tPayload: []byte(\"hello\"),\n})\n\ndefer producer.Close()\n\nif err != nil {\n    fmt.Println(\"Failed to publish message\", err)\n} else {\n    fmt.Println(\"Published message\")\n}\n```\n\nCreate a Consumer:\n\n```go\nclient, err := pulsar.NewClient(pulsar.ClientOptions{\n    URL: \"pulsar://localhost:6650\",\n})\n\ndefer client.Close()\n\nconsumer, err := client.Subscribe(pulsar.ConsumerOptions{\n        Topic:            \"my-topic\",\n        SubscriptionName: \"my-sub\",\n        Type:             pulsar.Shared,\n    })\n\ndefer consumer.Close()\n\nmsg, err := consumer.Receive(context.Background())\n    if err != nil {\n        log.Fatal(err)\n    }\n\nfmt.Printf(\"Received message msgId: %#v -- content: '%s'\\n\",\n            msg.ID(), string(msg.Payload()))\n\n```\n\nCreate a Reader:\n\n```go\nclient, err := pulsar.NewClient(pulsar.ClientOptions{URL: \"pulsar://localhost:6650\"})\nif err != nil {\n\tlog.Fatal(err)\n}\n\ndefer client.Close()\n\nreader, err := client.CreateReader(pulsar.ReaderOptions{\n\tTopic:          \"topic-1\",\n\tStartMessageID: pulsar.EarliestMessageID(),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer reader.Close()\n\nfor reader.HasNext() {\n\tmsg, err := reader.Next(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Received message msgId: %#v -- content: '%s'\\n\",\n\t\tmsg.ID(), string(msg.Payload()))\n}\n```\n\n## Build and Test\n\nBuild the sources:\n\n    make build\n\nRun the tests:\n\n    make test\n\nRun the tests with specific versions of GOLANG and PULSAR:\n\n    make test GO_VERSION=1.23 PULSAR_VERSION=4.0.3\n\n## Contributing\n\nContributions are welcomed and greatly appreciated. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.\n\nIf your contribution adds Pulsar features for Go clients, you need to update both the [Pulsar docs](https://pulsar.apache.org/docs/client-libraries/) and the [Client Feature Matrix](https://pulsar.apache.org/client-feature-matrix/). See [Contribution Guide](https://pulsar.apache.org/contribute/site-intro/#pages) for more details.\n\n## Community\n\n##### Mailing lists\n\n| Name                                                      | Scope                           |                                                       |                                                           |                                                                    |\n| :-------------------------------------------------------- | :------------------------------ | :---------------------------------------------------- | :-------------------------------------------------------- | :----------------------------------------------------------------- |\n| [users@pulsar.apache.org](mailto:users@pulsar.apache.org) | User-related discussions        | [Subscribe](mailto:users-subscribe@pulsar.apache.org) | [Unsubscribe](mailto:users-unsubscribe@pulsar.apache.org) | [Archives](http://mail-archives.apache.org/mod_mbox/pulsar-users/) |\n| [dev@pulsar.apache.org](mailto:dev@pulsar.apache.org)     | Development-related discussions | [Subscribe](mailto:dev-subscribe@pulsar.apache.org)   | [Unsubscribe](mailto:dev-unsubscribe@pulsar.apache.org)   | [Archives](http://mail-archives.apache.org/mod_mbox/pulsar-dev/)   |\n\n##### Slack\n\nPulsar slack channel `#dev-go` at https://apache-pulsar.slack.com/\n\nYou can self-register at https://apache-pulsar.herokuapp.com/\n\n## License\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n\n## Troubleshooting\n\n### Go module 'ambiguous import' error\n\nIf you've upgraded from a previous version of this library, you may run into an 'ambiguous import' error when building.\n\n```\ngithub.com/apache/pulsar-client-go/oauth2: ambiguous import: found package github.com/apache/pulsar-client-go/oauth2 in multiple modules\n```\n\nThe fix for this is to make sure you don't have any references in your `go.mod` file to the old oauth2 module path. So remove any lines\nsimilar to the following, and then run `go mod tidy`.\n\n```\ngithub.com/apache/pulsar-client-go/oauth2 v0.0.0-20220630195735-e95cf0633348 // indirect\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpulsar-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fpulsar-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fpulsar-client-go/lists"}