6.2. 编写 Service Registry Java 客户端应用程序
您可以使用 Service Registry Java 客户端类编写 Java 客户端应用程序来管理 Service Registry 中存储的工件。
先决条件
- Service Registry 已安装并在您的环境中运行。
- 您已为您的 Java 客户端应用程序创建了 Maven 项目。如需了解更多详细信息,请参阅 Apache Maven。
流程
在您的 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 创建 Service Registry 客户端,如下所示:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
创建客户端时,您可以使用客户端中的 Service Registry REST API 中提供的所有操作。如需了解更多详细信息,请参阅 Apicurio Registry REST API 文档。