2

我正在使用 Confluent 托管的 Kafka 集群和 Schema Registry 服务。我可以管理连接融合云 kafka 集群,将以下属性添加到生产者配置(Scala)

security.protocol
ssl.endpoint.identification.algorithm
sasl.mechanism
sasl.jaas.config
org.apache.kafka.common.security.plain.PlainLoginModule

但无法连接到融合云模式注册表。汇合云模式注册表提供访问密钥和秘密,但我不知道如何设置密钥和秘密。是否有任何用于访问融合云模式注册表的配置设置。

4

1 回答 1

2

添加以下属性将解决该问题。

import io.confluent.kafka.schemaregistry.client.SchemaRegistryClientConfig;


properties.put(SchemaRegistryClientConfig.BASIC_AUTH_CREDENTIALS_SOURCE, "USER_INFO")
properties.put(SchemaRegistryClientConfig.USER_INFO_CONFIG, <SCHEMA_REGISTRY_KEY> + ":" + <SCHEMA_REGISTRY_SECRET>)
于 2020-04-06T18:15:47.250 回答