本文整理汇总了Java中io.dropwizard.client.JerseyClientConfiguration.setConnectionRequestTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java JerseyClientConfiguration.setConnectionRequestTimeout方法的具体用法?Java JerseyClientConfiguration.setConnectionRequestTimeout怎么用?Java JerseyClientConfiguration.setConnectionRequestTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.dropwizard.client.JerseyClientConfiguration
的用法示例。
在下文中一共展示了JerseyClientConfiguration.setConnectionRequestTimeout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNewSecureClient
import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
protected Client getNewSecureClient(String keyStoreResourcePath) throws Exception {
TlsConfiguration tlsConfiguration = new TlsConfiguration();
tlsConfiguration.setKeyStorePath(new File(resourceFilePath(keyStoreResourcePath)));
tlsConfiguration.setKeyStorePassword("notsecret");
tlsConfiguration.setTrustStorePath(new File(resourceFilePath("tls/test-truststore.jks")));
tlsConfiguration.setTrustStorePassword("notsecret");
tlsConfiguration.setVerifyHostname(false);
tlsConfiguration.setSupportedCiphers(Lists.newArrayList("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"));
tlsConfiguration.setSupportedProtocols(Lists.newArrayList("TLSv1.2"));
JerseyClientConfiguration configuration = new JerseyClientConfiguration();
configuration.setTlsConfiguration(tlsConfiguration);
configuration.setTimeout(Duration.seconds(30));
configuration.setConnectionTimeout(Duration.seconds(30));
configuration.setConnectionRequestTimeout(Duration.seconds(30));
return new JerseyClientBuilder(USER_INFO_APP_RULE.getEnvironment())
.using(configuration)
.build(UUID.randomUUID().toString());
}
示例2: createClient
import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void createClient() {
final JerseyClientConfiguration configuration = new JerseyClientConfiguration();
configuration.setTimeout(Duration.minutes(1L));
configuration.setConnectionTimeout(Duration.minutes(1L));
configuration.setConnectionRequestTimeout(Duration.minutes(1L));
this.client = new JerseyClientBuilder(this.RULE.getEnvironment()).using(configuration)
.build("test client");
assertThat(this.client
.target(String.format(CREDENTIAL_END_POINT, this.RULE.getLocalPort()))
.request()
.header(X_AUTH_RSA_HEADER, BASE_64_PUBLIC_KEY)
.post(Entity.json(this.credential)).getStatus())
.isEqualTo(Status.CREATED.getStatusCode());
}
示例3: setupClass
import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@BeforeClass
public static void setupClass() {
// We need to enable typing otherwise abstract types, e.g. ExpressionItem, won't be deserialisable.
RULE.getEnvironment().getObjectMapper().enableDefaultTyping();
app = RULE.getApplication();
JerseyClientConfiguration clientConfiguration = new JerseyClientConfiguration();
clientConfiguration.setConnectionRequestTimeout(io.dropwizard.util.Duration.seconds(10));
clientConfiguration.setConnectionTimeout(io.dropwizard.util.Duration.seconds(10));
clientConfiguration.setTimeout(Duration.seconds(10));
client = new JerseyClientBuilder(RULE.getEnvironment())
.using(clientConfiguration)
.build("test client");
APPLICATION_PORT = RULE.getLocalPort();
ADMIN_PORT = RULE.getAdminPort();
// STATISTICS_URL = String.format("http://localhost:%d/statistics", APPLICATION_PORT);
QUERY_SEARCH_URL = String.format("http://localhost:%d" +
ResourcePaths.ROOT_PATH +
ResourcePaths.STROOM_STATS +
ResourcePaths.V2 +
QueryResource.SEARCH_ENDPOINT, APPLICATION_PORT);
BASE_TASKS_URL = String.format("http://localhost:%d/tasks/", ADMIN_PORT);
HEALTH_CHECKS_URL = String.format("http://localhost:%d/admin/healthcheck?pretty=true", ADMIN_PORT);
START_PROCESSING_URL = BASE_TASKS_URL + "startProcessing";
STOP_PROCESSING_URL = BASE_TASKS_URL + "stopProcessing";
LOGGER.info("Query url: {}", QUERY_SEARCH_URL);
LOGGER.info("Health checks url: {}", HEALTH_CHECKS_URL);
LOGGER.info("Start processing url: {}, e.g. curl -X POST {}", START_PROCESSING_URL, START_PROCESSING_URL);
LOGGER.info("Stop processing url: {}, e.g. curl -X POST {}", STOP_PROCESSING_URL, STOP_PROCESSING_URL);
}
示例4: createClient
import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void createClient() {
final JerseyClientConfiguration configuration = new JerseyClientConfiguration();
configuration.setTimeout(Duration.minutes(1L));
configuration.setConnectionTimeout(Duration.minutes(1L));
configuration.setConnectionRequestTimeout(Duration.minutes(1L));
this.client = new JerseyClientBuilder(this.RULE.getEnvironment()).using(configuration)
.build("test client");
}
示例5: setupClient
import io.dropwizard.client.JerseyClientConfiguration; //导入方法依赖的package包/类
@Before
public void setupClient() {
final JerseyClientConfiguration jerseyClientConfiguration = new JerseyClientConfiguration();
jerseyClientConfiguration.setConnectionTimeout(Duration.minutes(1L));
jerseyClientConfiguration.setConnectionRequestTimeout(Duration.minutes(1L));
jerseyClientConfiguration.setTimeout(Duration.minutes(1L));
client = new JerseyClientBuilder(this.RULE.getEnvironment())
.using(jerseyClientConfiguration)
.withProperty(ClientProperties.FOLLOW_REDIRECTS, Boolean.FALSE)
.build("test client");
}