use of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder in project openremote by openremote.
the class WebTargetBuilder method initClient.
protected static void initClient() {
if (client != null) {
return;
}
ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder().connectionPoolSize(CONNECTION_POOL_SIZE).connectionCheckoutTimeout(CONNECTION_CHECKOUT_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).socketTimeout(CONNECTION_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).establishConnectionTimeout(CONNECTION_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).register(new JacksonConfig());
if (asyncExecutorService != null) {
clientBuilder.asyncExecutor(asyncExecutorService);
}
client = clientBuilder.build();
}
use of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder in project syndesis-qe by syndesisio.
the class RestUtils method getClient.
public static Client getClient(ResteasyJackson2Provider jackson2Provider) throws RestClientException {
final ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(RestUtils.createAllTrustingClient());
final Client client = new ResteasyClientBuilder().providerFactory(// this is needed otherwise default jackson2provider is used, which causes problems with JDK8 Optional
new ResteasyProviderFactory()).register(jackson2Provider).httpEngine(engine).build();
return client;
}
use of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder in project brave by openzipkin.
the class ITTracingFeature_Client method currentSpanVisibleToUserFilters.
@Test
public void currentSpanVisibleToUserFilters() throws Exception {
server.enqueue(new MockResponse());
closeClient(client);
client = new ResteasyClientBuilder().asyncExecutor(httpTracing.tracing().currentTraceContext().executorService(executor)).register(TracingFeature.create(httpTracing)).register((ClientRequestFilter) requestContext -> requestContext.getHeaders().putSingle("my-id", currentTraceContext.get().traceIdString())).build();
get(client, "/foo");
RecordedRequest request = server.takeRequest();
assertThat(request.getHeader("x-b3-traceId")).isEqualTo(request.getHeader("my-id"));
takeSpan();
}
use of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder in project microservices by pwillhan.
the class ConsulModule method clientBuilder.
@Provides
@Singleton
public ClientBuilder clientBuilder(ObjectMapper objectMapper) {
ResteasyClientBuilder builder = new ResteasyClientBuilder();
builder.connectionPoolSize(20);
builder.register(new JacksonJaxbJsonProvider(objectMapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS), 100000);
return builder;
}
use of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder in project microservices by pwillhan.
the class ConsulModule method clientBuilder.
@Provides
@Singleton
public ClientBuilder clientBuilder(ObjectMapper objectMapper) {
ResteasyClientBuilder builder = new ResteasyClientBuilder();
builder.connectionPoolSize(20);
builder.register(new JacksonJaxbJsonProvider(objectMapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS), 100000);
return builder;
}
Aggregations