http - httpclient hard timout not working properly -
i using closeablehttpasyncclient perform number of requests without waiting other complete , setting hard timout of 1 minute. if suppose there 10 requests taking 4-5 minutes stop.
requestconfig requestconfig = requestconfig.custom() .setsockettimeout(3000) .setconnectionrequesttimeout(3000) .setconnecttimeout(3000).build(); closeablehttpasyncclient httpclient = httpasyncclients.custom() .setdefaultrequestconfig(requestconfig) .build(); timertask task = new timertask() { @override public void run() { if (request != null) { request.abort(); system.out.println( "request aborted"); } } }; new timer(true).schedule(task, hardtimeout * 10000);
please tell me whats wrong in this.
Comments
Post a Comment