当前位置: 首页>>代码示例>>Java>>正文


Java HttpEndpoint.getWebClient方法代码示例

本文整理汇总了Java中io.vertx.servicediscovery.types.HttpEndpoint.getWebClient方法的典型用法代码示例。如果您正苦于以下问题:Java HttpEndpoint.getWebClient方法的具体用法?Java HttpEndpoint.getWebClient怎么用?Java HttpEndpoint.getWebClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.servicediscovery.types.HttpEndpoint的用法示例。


在下文中一共展示了HttpEndpoint.getWebClient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: example3_webclient

import io.vertx.servicediscovery.types.HttpEndpoint; //导入方法依赖的package包/类
public void example3_webclient(ServiceDiscovery discovery) {
  HttpEndpoint.getWebClient(discovery, new JsonObject().put("name", "some-http-service"), ar -> {
    if (ar.succeeded()) {
      WebClient client = ar.result();

      // You need to path the complete path
      client.get("/api/persons")
        .send(response -> {

          // ...

          // Dont' forget to release the service
          ServiceDiscovery.releaseServiceObject(discovery, client);

        });
    }
  });
}
 
开发者ID:vert-x3,项目名称:vertx-service-discovery,代码行数:19,代码来源:HTTPEndpointExamples.java

示例2: evaluate

import io.vertx.servicediscovery.types.HttpEndpoint; //导入方法依赖的package包/类
@Override
public void evaluate(Handler<AsyncResult<Double>> resultHandler) {
  // ----
  // First we need to discover and get a HTTP client for the `quotes` service:
  HttpEndpoint.getWebClient(discovery, new JsonObject().put("name", "quotes"),
      client -> {
        if (client.failed()) {
          // It failed...
          resultHandler.handle(Future.failedFuture(client.cause()));
        } else {
          // We have the client
          WebClient webClient = client.result();
          computeEvaluation(webClient, resultHandler);
        }
      });

  // ---
}
 
开发者ID:cescoffier,项目名称:vertx-microservices-workshop,代码行数:19,代码来源:PortfolioServiceImpl.java

示例3: getWebClient

import io.vertx.servicediscovery.types.HttpEndpoint; //导入方法依赖的package包/类
public void getWebClient(Function<Record, Boolean> filter, Handler<AsyncResult<WebClient>> handler) {
    HttpEndpoint.getWebClient(serviceDiscovery, filter, handler);
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:4,代码来源:HttpServiceDiscovery.java

示例4: retrieveAuditService

import io.vertx.servicediscovery.types.HttpEndpoint; //导入方法依赖的package包/类
private Future<WebClient> retrieveAuditService() {
    Future<WebClient> future = Future.future();
    HttpEndpoint.getWebClient(discovery, new JsonObject().put("name", "audit-service"), future);
    return future;
}
 
开发者ID:cescoffier,项目名称:vertx-kubernetes-workshop,代码行数:6,代码来源:DashboardVerticle.java


注:本文中的io.vertx.servicediscovery.types.HttpEndpoint.getWebClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。