Examples of AsyncHttpClientConfigBean


Examples of com.ning.http.client.AsyncHttpClientConfigBean

    AsyncHttpClient fastClient = null;
    AsyncHttpClient slowClient = null;

    try {
      // create and configure async http client
      AsyncHttpClientConfigBean configFastClient = new AsyncHttpClientConfigBean();
      configFastClient.setConnectionTimeOutInMs(VarUtils.NING_FASTCLIENT_CONNECTION_TIMEOUT_MS);
      configFastClient.setRequestTimeoutInMs(VarUtils.NING_FASTCLIENT_REQUEST_TIMEOUT_MS);
      fastClient = new AsyncHttpClient(configFastClient);
     
      AsyncHttpClientConfigBean configSlowClient = new AsyncHttpClientConfigBean();
      configSlowClient.setConnectionTimeOutInMs(VarUtils.NING_SLOWCLIENT_CONNECTION_TIMEOUT_MS);
      configSlowClient.setRequestTimeoutInMs(VarUtils.NING_SLOWCLIENT_REQUEST_TIMEOUT_MS);
      slowClient = new AsyncHttpClient(configSlowClient);
     
      disableCertificateVerification();
    } catch (Exception e) {
      models.utils.LogUtils.printLogError("ERROR IN AsyncHttpClientFactorySafe " +e.getLocalizedMessage());
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClientConfigBean

        }
    }

    @Test(groups = { "standalone", "default_provider" })
    public void asyncHttpClientConfigBeanTest() throws Exception {
        AsyncHttpClient client = getAsyncHttpClient(new AsyncHttpClientConfigBean().setUserAgent("test"));
        try {
            Response response = client.executeRequest(client.prepareGet(getTargetUrl()).build()).get();
            assertEquals(200, response.getStatusCode());
        } finally {
            client.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.