[英]Kafka SASL_SSL Authentication error, how authenticate?
I'm working in Java with a pipeline that consumes data from a Kafka Cluster, it's available on我在 Java 工作,使用一条从 Kafka 集群消耗数据的管道,它可以在
https://github.com/confluentinc/confluent-google-examples/blob/master/ccloud-dataflow-demo/entry-df-pipeline/src/main/java/com/ecuevas/DataflowPipeline.java https://github.com/confluentinc/confluent-google-examples/blob/master/ccloud-dataflow-demo/entry-df-pipeline/src/main/java/com/ecuevas/DataflowPipeline.java
According to the repository, the props
and pipeline
are defined:根据存储库,
props
和pipeline
被定义为:
Map<String, Object> props = new HashMap<>();
props.put("auto.offset.reset", "earliest");
props.put("ssl.endpoint.identification.algorithm", "https");
props.put("sasl.mechanism", "PLAIN");
props.put("request.timeout.ms", 20000);
props.put("retry.backoff.ms", 500);
props.put("security.protocol", "SASL_SSL");
props.put("sasl.jaas.config",String.format("org.apache.kafka.common.security.
plain.PlainLoginModule required username=\"%s\" password=\"%s\";",username, password));
LogKafkaMsg logKafkaMsg = new LogKafkaMsg();
Pipeline pipeline = Pipeline.create(options);
PCollection<KV<String, String>> entries =
pipeline
.apply(
"Read Entries from Confluent Cloud Topic",
KafkaIO.<String, String>read()
.withBootstrapServers("<your-bootstrap-server>")
.withTopic("entries")
.withConsumerConfigUpdates(props)
.withKeyDeserializer(StringDeserializer.class)
.withValueDeserializer(StringDeserializer.class)
.withoutMetadata()
);
My problem is when the code is executed, returns the following error:我的问题是执行代码时,返回以下错误:
at org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:969)
at org.apache.beam.runners.dataflow.DataflowRunner.run(DataflowRunner.java:198)
at org.apache.beam.sdk.Pipeline.run(Pipeline.java:322)
at org.apache.beam.sdk.Pipeline.run(Pipeline.java:308)
at com.ecuevas.DataflowPipeline.main(DataflowPipeline.java:214)
Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Invalid SASL/PLAIN response: expected 3 tokens, got 4
Probably the issue is related with the SASL/PLAIN authentication, but I don't know a possible solution.问题可能与 SASL/PLAIN 身份验证有关,但我不知道可能的解决方案。 I think that is related with:
我认为这与以下方面有关:
ca-cert
, ca-key
, ca-password
or another special. ca-cert
、 ca-key
、 ca-password
或其他特殊的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.