How to use the node-rdkafka.createWriteStream function in node-rdkafka

To help you get started, we’ve selected a few node-rdkafka examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ancashoria / graphql-kafka-subscriptions / src / kafka-pubsub.ts View on Github external
private createProducer(topic: string) {
    const producer = Kafka.createWriteStream(
        Object.assign({}, {'metadata.broker.list': this.brokerList()}, this.options.globalConfig),
        {},
        {topic}
    );
    producer.on('error', (err) => {
      this.logger.error(err, 'Error in our kafka stream')
    })
    return producer
  }
github ancashoria / graphql-kafka-subscriptions / dist / kafka-pubsub.js View on Github external
KafkaPubSub.prototype.createProducer = function (topic) {
        var _this = this;
        var producer = Kafka.createWriteStream(Object.assign({}, { 'metadata.broker.list': this.brokerList() }, this.options.globalConfig), {}, { topic: topic });
        producer.on('error', function (err) {
            _this.logger.error(err, 'Error in our kafka stream');
        });
        return producer;
    };
    KafkaPubSub.prototype.createConsumer = function (topic) {