赞
踩
java client 中添加 SASL 设置信息:
Java client consumer properties配置.png
注意 sasl.jaas.config 配置中的分号必不可少。
package kafka;
import java.time.Duration;
import java.util.Arrays;
import java.util.Properties;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestKafkaSasl {
private static final Logger logger = LoggerFactory.getLogger(TestKafkaSasl.class);
public static void main(String[] args) {
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.pu
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。