Example usage for org.springframework.http.client Netty4ClientHttpRequestFactory Netty4ClientHttpRequestFactory

List of usage examples for org.springframework.http.client Netty4ClientHttpRequestFactory Netty4ClientHttpRequestFactory

Introduction

In this page you can find the example usage for org.springframework.http.client Netty4ClientHttpRequestFactory Netty4ClientHttpRequestFactory.

Prototype

public Netty4ClientHttpRequestFactory() 

Source Link

Document

Create a new Netty4ClientHttpRequestFactory with a default NioEventLoopGroup .

Usage

From source file:com.bodybuilding.argos.discovery.ClusterListDiscovery.java

public ClusterListDiscovery() {
    super(UPDATE_INTERVAL, TimeUnit.MILLISECONDS);
    Netty4ClientHttpRequestFactory requestFactory = new Netty4ClientHttpRequestFactory();
    requestFactory.setConnectTimeout(10_000);
    requestFactory.setReadTimeout(10_000);
    this.restTemplate = new RestTemplate(requestFactory);
}

From source file:com.navercorp.pinpoint.plugin.spring.web.RestTemplateIT.java

@Test
public void test3() throws Exception {
    RestTemplate restTemplate = new RestTemplate(new Netty4ClientHttpRequestFactory());
    String forObject = restTemplate.getForObject(webServer.getCallHttpUrl(), String.class);

    PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
    verifier.printCache();/*w  w  w  . j  a  v  a  2 s .c o m*/

    verifier.verifyTrace(event("REST_TEMPLATE", RestTemplate.class.getConstructor()));
    verifier.verifyTrace(event("REST_TEMPLATE",
            "org.springframework.http.client.AbstractAsyncClientHttpRequest.executeAsync()"));
    verifier.verifyTrace(event("REST_TEMPLATE", "RestTemplate execAsync Result Invocation"));
    verifier.verifyTrace(event("ASYNC", "Asynchronous Invocation"));
    verifier.verifyTrace(event("REST_TEMPLATE",
            "org.springframework.util.concurrent.SettableListenableFuture.set(java.lang.Object)",
            annotation("http.status.code", 200)));
}