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