7.4. 使用 Kafka 使用者客户端的 schema
此流程描述了如何配置使用 Java 编写的 Kafka 使用者客户端,以使用 Service Registry 中的 schema。
前提条件
- 已安装服务 Registry
- 架构在 Service Registry 中注册
流程
使用 Service Registry 的 URL 配置客户端。例如:
String registryUrl = "https://registry.example.com/apis/registry/v2"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);
String registryUrl = "https://registry.example.com/apis/registry/v2"; Properties props = new Properties(); props.putIfAbsent(SerdeConfig.REGISTRY_URL, registryUrl);
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用 Service Registry deserializer 配置客户端。例如:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1. 由 Service Registry 提供的反序列化器。
- 2.反序列化采用 Apache Avro JSON 格式。