krakend / krakend-pubsub

a pubsub backend for the KrakenD framework
https://www.krakend.io
Apache License 2.0
10 stars 17 forks source link

How to pass security protocol, mechanism user and pass to connect to kafka #24

Open raafael opened 4 months ago

raafael commented 4 months ago

Hello! I didn't find in the docs more information about different kafka configurations to connect, I am using a bintami kafka helm deployed in k8s and my configuration to connect to the brooker in my microservices is like that:

kafka.bootstrap.servers=xxxxx kafka.security.protocol=SASL_PLAINTEXT kafka.sasl.mechanism=SCRAM-SHA-256 kafka.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="" password=""; kafka.session.timeout.ms=30000

Is possible to connect in kafka like this with krakend ?

0xMattijs commented 2 months ago

It looks like no config is passed to the underlying kafkapubsub constructor:

https://github.com/krakend/krakend-pubsub/blob/07b35837bb1880d13b7550fcdd45a5eb5f556edb/client.go#L74

It would be nice if settings from the extra config could be picked up and passed here, since this seems possible according to the docs: https://pkg.go.dev/gocloud.dev/pubsub/kafkapubsub#example-OpenTopic

Eventually the config will be passed to Sarama: https://pkg.go.dev/github.com/IBM/sarama#Config, which offers all the nice knobs.