graphql-kafka-subscriptions
Apollo graphql subscriptions over Kafka protocol
One producer and one consumer for each node instance. Communication happens over a single kafka topic.
Installation
npm install graphql-kafka-subscriptions
Usage
const pubsub = topic: 'anything' host: 'INSERT_KAFKA_IP' port: 'INSERT_KAFKA_PORT'
With multiple Kafka nodes
const pubsub = topic: 'anything' host: 'kafka-10.development.foobar.com:9092,kafka-21.development.foobar.com:9092,kafka-22.development.foobar.com:9092'
// as mentioned in the comments of https://github.com/ancashoria/graphql-kafka-subscriptions/issues/4// you will need to upate the site calls of `publish` in your application as called out below. // the stock PubSub::publish expects a string and an object pubsub; // KafkaPubSub::publish expects the first parameter to be inserted into the object pubsub;
Special thanks to:
- davidyaha for graphql-redis-subscriptions which was the main inspiration point for this project
- Apollo graphql community
Help greatly appreciated