国人经典wordpress主题liveo,seo工作是什么意思,学网页设计的培训,给一个网站场景
部分场景会指定使用某一kafka 来提高安全性#xff0c;这里就不得不使用用户密码认证方式等来控制
方法示例 // 手动加载配置信息private MapString, Object consumerConfigs() {MapString, Object props new HashMap();props.put(ConsumerCo…场景
部分场景会指定使用某一kafka 来提高安全性这里就不得不使用用户密码认证方式等来控制
方法示例 // 手动加载配置信息private MapString, Object consumerConfigs() {MapString, Object props new HashMap();props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, serverUrl);props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, enableAutoCommit);props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, autoOffsetReset);// 用户密码 以及认证方式等配置的加载方式if (StringUtils.isNotEmpty(username)) {String jaasTemplate org.apache.kafka.common.security.scram.ScramLoginModule required username\%s\ %s\%s\;;String jaasCfg String.format(jaasTemplate, username, password, password);props.put(sasl.mechanism,StringUtils.isNotEmpty(saslMechanism) ? saslMechanism : PLAIN);props.put(security.protocol,StringUtils.isNotEmpty(securityProtocol) ? securityProtocol : SASL_PLAINTEXT);props.put(sasl.jaas.config, jaasCfg);}return props;}