當前位置: 首頁>>代碼示例>>Java>>正文


Java ConsulClientOptions類代碼示例

本文整理匯總了Java中io.vertx.ext.consul.ConsulClientOptions的典型用法代碼示例。如果您正苦於以下問題:Java ConsulClientOptions類的具體用法?Java ConsulClientOptions怎麽用?Java ConsulClientOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConsulClientOptions類屬於io.vertx.ext.consul包,在下文中一共展示了ConsulClientOptions類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import io.vertx.ext.consul.ConsulClientOptions; //導入依賴的package包/類
@Before
public void setUp(TestContext tc) throws Exception {
  vertx = Vertx.vertx();
  vertx.exceptionHandler(tc.exceptionHandler());

  client = ConsulClient.create(vertx, new ConsulClientOptions().setPort(consulProcess.getHttpPort()));
}
 
開發者ID:vert-x3,項目名稱:vertx-config,代碼行數:8,代碼來源:ConsulConfigStoreTest.java

示例2: timeout

import io.vertx.ext.consul.ConsulClientOptions; //導入依賴的package包/類
@Test
public void timeout(TestContext tc) {
  SlowHttpServer slowConsul = new SlowHttpServer(vertx, 10000);
  ConsulClient client = ctx.createClient(new ConsulClientOptions().setPort(slowConsul.port()).setTimeout(1000));
  client.agentInfo(tc.asyncAssertFailure(t -> {
    ctx.closeClient(client);
    slowConsul.close();
    tc.assertTrue(t.getMessage().contains("The timeout period of 1000ms"));
  }));
}
 
開發者ID:vert-x3,項目名稱:vertx-consul-client,代碼行數:11,代碼來源:BrokenConsul.java

示例3: closedConnection

import io.vertx.ext.consul.ConsulClientOptions; //導入依賴的package包/類
@Test
public void closedConnection(TestContext tc) {
  BrokenHttpServer brokenConsul = new BrokenHttpServer(vertx);
  ConsulClient client = ctx.createClient(new ConsulClientOptions().setPort(brokenConsul.port()));
  client.agentInfo(tc.asyncAssertFailure(t -> {
    ctx.closeClient(client);
    brokenConsul.close();
    tc.assertTrue(t.getMessage().contains("Connection was closed"));
  }));
}
 
開發者ID:vert-x3,項目名稱:vertx-consul-client,代碼行數:11,代碼來源:BrokenConsul.java

示例4: init

import io.vertx.ext.consul.ConsulClientOptions; //導入依賴的package包/類
@Override
public void init(Vertx vertx, JsonObject config) {
  ConsulClientOptions opt = new ConsulClientOptions(config);
  this.client = ConsulClient.create(vertx, opt);
}
 
開發者ID:vert-x3,項目名稱:vertx-service-discovery,代碼行數:6,代碼來源:ConsulBackendService.java

示例5: ConsulConfigStore

import io.vertx.ext.consul.ConsulClientOptions; //導入依賴的package包/類
ConsulConfigStore(Vertx vertx, JsonObject configuration) {
  client = ConsulClient.create(vertx, new ConsulClientOptions(configuration));
  delimiter = configuration.getString("delimiter", "/");
  prefix = prefix(configuration.getString("prefix"), delimiter);
}
 
開發者ID:vert-x3,項目名稱:vertx-config,代碼行數:6,代碼來源:ConsulConfigStore.java


注:本文中的io.vertx.ext.consul.ConsulClientOptions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。