|
|
|
@ -28,7 +28,9 @@ public class HttpJobHandler extends IJobHandler {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// httpclient
|
|
|
|
|
HttpClient httpClient = new HttpClient();
|
|
|
|
|
HttpClient httpClient = null;
|
|
|
|
|
try {
|
|
|
|
|
httpClient = new HttpClient();
|
|
|
|
|
httpClient.setFollowRedirects(false); // Configure HttpClient, for example:
|
|
|
|
|
httpClient.start(); // Start HttpClient
|
|
|
|
|
|
|
|
|
@ -47,6 +49,15 @@ public class HttpJobHandler extends IJobHandler {
|
|
|
|
|
String responseMsg = response.getContentAsString();
|
|
|
|
|
XxlJobLogger.log(responseMsg);
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
XxlJobLogger.log(e);
|
|
|
|
|
return FAIL;
|
|
|
|
|
} finally {
|
|
|
|
|
if (httpClient != null) {
|
|
|
|
|
httpClient.stop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|