6.2. 编写 Service Registry Java 客户端应用程序
本节介绍如何使用 Java 客户端应用程序管理 Service Registry 中存储的工件。
前提条件
- Service Registry 在您的环境中安装并运行
流程
在 Maven 项目中添加以下依赖项:
<dependency> <groupId>io.apicurio</groupId> <artifactId>apicurio-registry-client</artifactId> <version>${apicurio-registry.version}</version> </dependency>
<dependency> <groupId>io.apicurio</groupId> <artifactId>apicurio-registry-client</artifactId> <version>${apicurio-registry.version}</version> </dependency>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 按照以下方法创建 registry 客户端:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
如果您指定了
https://my-registry.my-domain.com
的示例 registry URL,客户端将自动附加/apis/registry/v2
。 - 有关创建 Service Registry 客户端时的更多信息,请参见下一节中的 Java 客户端配置。
-
如果您指定了
创建客户端后,您可以使用客户端中的 Service Registry REST API 中的所有操作。如需了解更多详细信息,请参阅 Apicurio Registry REST API 文档。