ScorpioBroker icon indicating copy to clipboard operation
ScorpioBroker copied to clipboard

Connecting to Kafka

Open glagnar opened this issue 4 years ago • 5 comments

I am trying to set the following parameters for kafka:

bootstrap.servers=pkc-e8mp5.eu-west-1.aws.confluent.cloud:9092
ssl.endpoint.identification.algorithm=https
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="{{ CLUSTER_API_KEY }}" password="{{ CLUSTER_API_SECRET }}";

but I am not having much luck. I am trying to do something like below - for running in docker. Screenshot 2020-10-22 at 23 59 34

glagnar avatar Oct 22 '20 22:10 glagnar

If you like, I can let you have my username and key if you need to test 😃

glagnar avatar Oct 22 '20 22:10 glagnar

Hi, i think i got the problem. We are using also the spring cloud kafka binders which are using another config option. We haven't really yet played with this scenarios so this isn't properly documented. Sorry about that. If you add the --spring.cloud.stream.kafka.binder. options should do the trick --spring.cloud.stream.kafka.binder.brokers is the only one we are setting manually please find the security settings for this here https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html#_example_security_configuration

BR

ScorpioBroker avatar Oct 23 '20 13:10 ScorpioBroker

I am now able to connect to Kafka, but only when I change the application.yml file directly. The setup below actually works, and connects to a cloud hosted Kafka instance. Could you perhaps please advise me how to do the same configuration via. parameters to the Docker container ? It seems to be slightly more complicated to pass the security information to the docker container, so perhaps you have a solution. @ScorpioBroker

Screenshot 2020-11-02 at 13 32 04

glagnar avatar Nov 02 '20 12:11 glagnar

I was trying to use the AIO-Deployment with an external Kafka (MKS in my case). Setting the environment variable BOOTSTRAP_SERVERS for the container was all I had to do in my case. This will override the internal bootstrap.servers entry.

Blobonat avatar Jul 24 '22 12:07 Blobonat

@Glagnar Do you know if these same parameters can be used with the Scorpio Broker to authenticate with OAuth Bearer tokens?

PeskyPotato avatar Apr 03 '23 08:04 PeskyPotato