resteasy设置timeout

默认的方式 connection time out 为20s
ClientRequest request = new ClientRequest(url);


指定time out
还可以设置请求超时 SoTimeout
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpParams params = httpClient.getParams();
        HttpConnectionParams.setConnectionTimeout(params, connectionTimeoutMillis);
        HttpConnectionParams.setSoTimeout(params, socketTimeoutMillis);
        ClientExecutor executor = new ApacheHttpClient4Executor(httpClient);

        ClientRequest request = new ClientRequest(url, executor);

你可能感兴趣的:(resteasy)