All Projects → ancashoria → Graphql Kafka Subscriptions

ancashoria / Graphql Kafka Subscriptions

Licence: mit
Apollo graphql subscriptions over Kafka protocol

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Graphql Kafka Subscriptions

React Fullstack Graphql
Starter projects for fullstack applications based on React & GraphQL.
Stars: ✭ 1,352 (+777.92%)
Mutual labels:  graphql, apollographql, graphql-subscriptions
Angular Fullstack Graphql
🚀 Starter projects for fullstack applications based on Angular & GraphQL.
Stars: ✭ 92 (-40.26%)
Mutual labels:  graphql, apollographql, graphql-subscriptions
Booben
Web app constructor based on React, with GraphQL bindings
Stars: ✭ 96 (-37.66%)
Mutual labels:  graphql, apollographql
Graphql Subscriptions
📰 A small module that implements GraphQL subscriptions for Node.js
Stars: ✭ 1,390 (+802.6%)
Mutual labels:  graphql, graphql-subscriptions
React Graphql Github Apollo
🚀 A React + Apollo + GraphQL GitHub Client. Your opportunity to learn about these technologies in a real world application.
Stars: ✭ 1,563 (+914.94%)
Mutual labels:  graphql, apollographql
Apollo Prophecy
🔮 GraphQL error management made Easy, generate custom machine-readable errors for Apollo Client/Server from the CLI
Stars: ✭ 83 (-46.1%)
Mutual labels:  graphql, apollographql
Graphql Log
Add logging to your GraphQL resolvers so you know what's going on in your app.
Stars: ✭ 94 (-38.96%)
Mutual labels:  graphql, apollographql
Graphql Codegen Hasura
code-generator plugins for hasura/apollo-gql/typescript development
Stars: ✭ 113 (-26.62%)
Mutual labels:  graphql, apollographql
Apollo Mocked Provider
Automatically mock GraphQL data with a mocked ApolloProvider
Stars: ✭ 70 (-54.55%)
Mutual labels:  graphql, apollographql
Graphql Postgres Subscriptions
A graphql subscriptions implementation using postgres and apollo's graphql-subscriptions
Stars: ✭ 133 (-13.64%)
Mutual labels:  graphql, graphql-subscriptions
Apollo Federation Ruby
A Ruby implementation of Apollo Federation
Stars: ✭ 131 (-14.94%)
Mutual labels:  graphql, apollographql
Graphql Mqtt Subscriptions
graphql-subscriptions implementation for MQTT protocol
Stars: ✭ 133 (-13.64%)
Mutual labels:  graphql, graphql-subscriptions
Open Bank Mark
A bank simulation application using mainly Clojure, which can be used to end-to-end test and show some graphs.
Stars: ✭ 81 (-47.4%)
Mutual labels:  graphql, kafka
Graphql Rxjs
fork of Graphql which adds Observable support
Stars: ✭ 78 (-49.35%)
Mutual labels:  graphql, graphql-subscriptions
Apollo Server
🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
Stars: ✭ 12,145 (+7786.36%)
Mutual labels:  graphql, apollographql
Graphql Google Pubsub
A graphql-subscriptions PubSub Engine using Google PubSub
Stars: ✭ 108 (-29.87%)
Mutual labels:  graphql, graphql-subscriptions
Data Source Base
Boilerplate for creating a GrAMPS-compatible data source.
Stars: ✭ 52 (-66.23%)
Mutual labels:  graphql, apollographql
Vue Apollo Todos
Vue Apollo GraphQL mutation examples
Stars: ✭ 69 (-55.19%)
Mutual labels:  graphql, apollographql
Apollo2 Subscriptions How To
Apollo Server 2 how to setup subscriptions
Stars: ✭ 125 (-18.83%)
Mutual labels:  graphql, apollographql
Githunt Angular
An Apollo with Angular full-stack example app: vote for your favorite GitHub repos!
Stars: ✭ 144 (-6.49%)
Mutual labels:  graphql, apollographql

graphql-kafka-subscriptions

It 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.

Installation

npm install graphql-kafka-subscriptions

Mac OS High Sierra / Mojave

OpenSSL 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:

export CPPFLAGS=-I/usr/local/opt/openssl/include
export LDFLAGS=-L/usr/local/opt/openssl/lib

Then you can run npm install on your application to get it to build correctly.

Usage

Initializing the kafka pubsub client

import { KafkaPubSub } from 'graphql-kafka-subscriptions'

export const pubsub = new KafkaPubSub({
  topic: 'name-of-the-topic',
  host: 'INSERT_KAFKA_IP',
  port: 'INSERT_KAFKA_PORT',
  globalConfig: {} // options passed directly to the consumer and producer
})

Publishing messages to the subcrition

payload = {
  firstName: "John",
  lastName: "Doe"
}

pubsub.publish('pubSubChannel', payload);

Subscribing to a channel

const onMessage = (payload) => {
  console.log(payload);
}

const subscription = await pubsub.subscribe('pubSubChannel', onMessage)

Contributing

Contributions 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.

For sending a PR follow:

  1. Fork it (https://github.com/ancashoria/graphql-kafka-subscriptions/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Horia Miron notes:

Thanks to davidyaha for graphql-redis-subscriptions which was the main inspiration point for this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].