-
public class ClientExample {
+import io.vertx.core.Vertx;public class ClientExample {
public static void main(String[] args) throws Exception {
- // Create a registry client
- String registryUrl = "https://my-registry.my-domain.com/apis/registry/v3"; (1)
- VertXRequestAdapter vertXRequestAdapter = new VertXRequestAdapter(VertXAuthFactory.defaultVertx);
- vertXRequestAdapter.setBaseUrl(REGISTRY_URL);
+ // Create a registry client
+ String registryUrl = "https://my-registry.my-domain.com/apis/registry/v3"; (1)
+ Vertx vertx = Vertx.vertx(); (2)
+ VertXRequestAdapter vertXRequestAdapter = new VertXRequestAdapter(vertx);
+ vertXRequestAdapter.setBaseUrl(REGISTRY_URL);
- RegistryClient client = new RegistryClient(vertXRequestAdapter); (2)
+ RegistryClient client = new RegistryClient(vertXRequestAdapter); (3)
+
+ // Use client here
+
+ vertx.close(); (4)
}
}
@@ -419,8 +424,16 @@