{"id":21660190,"url":"https://github.com/ancashoria/graphql-kafka-subscriptions","last_synced_at":"2025-07-17T23:31:03.180Z","repository":{"id":25294428,"uuid":"103666249","full_name":"ancashoria/graphql-kafka-subscriptions","owner":"ancashoria","description":"Apollo graphql subscriptions over Kafka protocol","archived":false,"fork":false,"pushed_at":"2024-04-12T18:44:50.000Z","size":677,"stargazers_count":187,"open_issues_count":24,"forks_count":55,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-29T23:34:48.343Z","etag":null,"topics":["apollographql","graphql","graphql-subscriptions","kafka"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ancashoria.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":"2017-09-15T14:27:14.000Z","updated_at":"2024-06-18T18:22:54.578Z","dependencies_parsed_at":"2024-06-18T18:22:48.572Z","dependency_job_id":"bc4188e9-6c17-451f-a36e-7a85dedecbad","html_url":"https://github.com/ancashoria/graphql-kafka-subscriptions","commit_stats":{"total_commits":37,"total_committers":13,"mean_commits":"2.8461538461538463","dds":0.4864864864864865,"last_synced_commit":"fe40796e7082d458cdfd23c5efb7707c34ec6621"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancashoria%2Fgraphql-kafka-subscriptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancashoria%2Fgraphql-kafka-subscriptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancashoria%2Fgraphql-kafka-subscriptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancashoria%2Fgraphql-kafka-subscriptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ancashoria","download_url":"https://codeload.github.com/ancashoria/graphql-kafka-subscriptions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226306109,"owners_count":17603933,"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":["apollographql","graphql","graphql-subscriptions","kafka"],"created_at":"2024-11-25T09:32:28.347Z","updated_at":"2024-11-25T09:34:28.218Z","avatar_url":"https://github.com/ancashoria.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# graphql-kafka-subscriptions\n\nIt implements the PubSubEngine Interface from the graphql-subscriptions package and also the new AsyncIterator interface. It allows you to connect your subscriptions manager to a single Kafka topic used as Pub/Sub communication channel.\n\n## Installation\n\n`npm install graphql-kafka-subscriptions`\n\n### Mac OS High Sierra / Mojave\n\nOpenSSL has been upgraded in High Sierra and homebrew does not overwrite default system libraries. That means when building node-rdkafka, because you are using openssl, you need to tell the linker where to find it:\n\n```sh\nexport CPPFLAGS=-I/usr/local/opt/openssl/include\nexport LDFLAGS=-L/usr/local/opt/openssl/lib\n```\n\nThen you can run `npm install` on your application to get it to build correctly.\n\n## Usage\n\n\n### Initializing the kafka pubsub client\n\n```js\nimport { KafkaPubSub } from 'graphql-kafka-subscriptions'\n\nexport const pubsub = new KafkaPubSub({\n  topic: 'name-of-the-topic',\n  host: 'INSERT_KAFKA_IP',\n  port: 'INSERT_KAFKA_PORT',\n  globalConfig: {} // options passed directly to the consumer and producer\n})\n```\n\n### Publishing messages to the subcrition\n\n```js\npayload = {\n  firstName: \"John\",\n  lastName: \"Doe\"\n}\n\npubsub.publish('pubSubChannel', payload);\n```\n\n###  Subscribing to a channel\n\n```js\nconst onMessage = (payload) =\u003e {\n  console.log(payload);\n}\n\nconst subscription = await pubsub.subscribe('pubSubChannel', onMessage)\n```\n\n## Contributing\n\nContributions are welcome. Make sure to check the existing issues (including the closed ones) before requesting a feature, reporting a bug or opening a pull requests.\n\nFor sending a PR follow:\n\n1. Fork it (\u003chttps://github.com/ancashoria/graphql-kafka-subscriptions/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n\n**Horia Miron notes:**\n\nThanks to [davidyaha][1] for [graphql-redis-subscriptions][2] which was the main inspiration point for this project.\n\n[1]: https://github.com/davidyaha\n[2]: https://github.com/davidyaha/graphql-redis-subscriptions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancashoria%2Fgraphql-kafka-subscriptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fancashoria%2Fgraphql-kafka-subscriptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancashoria%2Fgraphql-kafka-subscriptions/lists"}