提交 28ab5c8d authored 作者: 姜武杰's avatar 姜武杰

测试连接请求

上级 3b655800
......@@ -94,12 +94,18 @@ public class TempController {
@Operation(summary = "大量httputil调用", description = "<br>By:姜武杰")
@RequestMapping(value = "/temp-job", method = RequestMethod.GET)
public Result<Void> saveOrderChildExpectTime() {
public Result<Void> saveOrderChildExpectTime(@RequestParam(value="type") Integer type) {
for (int i = 0; i < 1000; i++) {
// 多线程调用 HttpsUtils 请求 百度
new Thread(() -> {
try {
HttpsUtils.doPost("https://www.bing.com", "a=" + System.currentTimeMillis(), 30000, 50000);
String result = null;
if (type == 1) {
result = HttpsUtils.doPost("https://www.bing.com", "a=" + System.currentTimeMillis(), 30000, 50000);
} else {
result = HttpsUtils.doPost("https://www.bing.com", "a=" + System.currentTimeMillis(), 30000, 50000);
}
log.info("========>type:{}, result:{}", type, result);
} catch (Exception e) {
log.info(e.getMessage(), e);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论