kafka-streams icon indicating copy to clipboard operation
kafka-streams copied to clipboard

JS client configuration broken?

Open unfrgivn opened this issue 4 years ago • 0 comments

I see this library uses node-sinek which allows for running native or JS consumer/producers, but I don't see any way to force this library to use the new JS client? Both the native and JS clients use the same config with the noptions key in the newer versions of node-sinek and you only differentiate by loading different modules from the package. When I try to run kafka-streams though I get Error: You have to install node-rdkafka to use NConsumer. Looks like you are only able to use the older node-sinek JS client set with the options key?

Based on the KafkaFactory.js

if (this.config.noptions && typeof this.config.noptions === "object") {
    debug("creating new native kafka client");
    return new NativeKafkaClient(topic, this.config, this.batchOptions);
}
.
.
.
debug("creating new js kafka client");
return new JSKafkaClient(topic, this.config);

This seems incorrect based on the fact that the node-sinek JSConsumer/Producer also use config.noptions now https://github.com/nodefluent/node-sinek/blob/master/lib/kafkajs/JSConsumer.js

unfrgivn avatar Mar 07 '20 01:03 unfrgivn