use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider 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 com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider 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 com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.
the class AbstractArchivaRestTest method getCommonServices.
protected CommonServices getCommonServices(String authzHeader) {
CommonServices service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", CommonServices.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
if (authzHeader != null) {
WebClient.client(service).header("Authorization", authzHeader);
}
WebClient.client(service).header("Referer", "http://localhost:" + port);
WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(100000000);
WebClient.client(service).accept(MediaType.APPLICATION_JSON_TYPE);
WebClient.client(service).type(MediaType.APPLICATION_JSON_TYPE);
return service;
}
use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.
the class AbstractArchivaRestTest method getProxyConnectorService.
protected ProxyConnectorService getProxyConnectorService() {
ProxyConnectorService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", ProxyConnectorService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
WebClient.client(service).header("Authorization", authorizationHeader);
WebClient.client(service).header("Referer", "http://localhost:" + port);
WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000);
WebClient.client(service).accept(MediaType.APPLICATION_JSON_TYPE);
WebClient.client(service).type(MediaType.APPLICATION_JSON_TYPE);
return service;
}
use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.
the class AbstractArchivaRestTest method getSearchService.
protected SearchService getSearchService(String authzHeader) {
// START SNIPPET: cxf-searchservice-creation
SearchService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", SearchService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
// to add authentification
if (authzHeader != null) {
WebClient.client(service).header("Authorization", authzHeader);
}
// Set the Referer header to your archiva server url
WebClient.client(service).header("Referer", "http://localhost:" + port);
// to configure read timeout
WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(100000000);
// if you want to use json as exchange format xml is supported too
WebClient.client(service).accept(MediaType.APPLICATION_JSON_TYPE);
WebClient.client(service).type(MediaType.APPLICATION_JSON_TYPE);
return service;
// END SNIPPET: cxf-searchservice-creation
}
Aggregations