I have following configs for kafka producer factory:
put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS);
put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
put("security.protocol", "SASL_PLAINTEXT");
put("sasl.mechanism", "PLAIN");
put("sasl.jaas.config", String.format(
"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"%s\" password=\"%s\";", KAFKA_USER, KAFKA_PASSWORD));
put(ProducerConfig.CLIENT_ID_CONFIG, "svc.postsales");
But I am constantly getting errors like this: org.apache.kafka.common.errors.ClusterAuthorizationException: Cluster authorization failed.
But as my devops says and shows on screen he is logged in as producer using my credentials and sent a message to topic.
I tried SCRAM authorization, but it doesn't work: failed authentication due to: Client SASL mechanism 'SCRAM-SHA-256' not enabled in the server, enabled mechanisms are [PLAIN]"}
Can you please help?