This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.SaslAuthenticationException: Role cannot be empty. #1927
-
After I configure the I have checked all configurations with reference to the documentation: https://github.com/streamnative/kop/blob/master/docs/security.md#plain This is usually related to what configuration, thank you! The client code: Properties props = new Properties();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "pulsar:" + 9092);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
String jaasTemplate = "org.apache.kafka.common.security.plain.PlainLoginModule "
+ "required username=\"%s\" password=\"%s\";";
String jaasCfg = String.format(jaasTemplate, "public", "token:" + "token value");
props.put("sasl.jaas.config", jaasCfg);
props.put("security.protocol", "SASL_PLAINTEXT");
props.put("sasl.mechanism", "PLAIN");
var producer = new KafkaProducer<>(props); |
Beta Was this translation helpful? Give feedback.
Answered by
KamenRiderKuuga
Jun 28, 2023
Replies: 1 comment
-
Resolved in #1929 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
KamenRiderKuuga
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved in #1929