ancashoria / graphql-kafka-subscriptions

Apollo graphql subscriptions over Kafka protocol
MIT License
187 stars 55 forks source link

SASL support #22

Closed GeorgeBellOV closed 4 years ago

GeorgeBellOV commented 4 years ago

Good day,

First of all, good job on the library, its really easy to use. Will you consider building in sasl support? I would like to connect to confluent.cloud to use the kafka as pubsub as we are already using it for a different consumption purpose. I would help and do a PR if required?

Thank you

GeorgeBellOV commented 4 years ago

Hi,

So I got this working with your global config setting. Great job again on the library, its works very well.

My settings now look like this: module.exports = new KafkaPubSub({ topic: config.get('kafka.topic'), host: config.get('kafka.host'), port: config.get('kafka.port'), globalConfig: { 'bootstrap.servers': config.get('kafka.servers'), 'security.protocol': config.get('kafka.protocol'), 'sasl.username': config.get('kafka.username'), 'sasl.password': config.get('kafka.password'), 'sasl.mechanisms': config.get('kafka.mechanisms'), }, // options passed directly to the consumer and producer });

And this allows me to connect to confluent.cloud.

Davenporten commented 4 years ago

@GeorgeBellOV How did you know to pass things in like sasl.password? I want to use a token rather than username/password but I'm not sure what the right key would be for this.