Browse Source

feat(all): 修改梦天推送请求的超时时间

dist.1.3.0
zhaoqiaobo 6 months ago
parent
commit
5242e99df0
  1. 11
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

11
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

@ -328,23 +328,24 @@ public class NodeDataPushListener {
HttpRequest post = HttpUtil.createPost(mengTianProperties.getHost() + url);
post.header("ClientId", "mt.ht");
post.header("OperationCode", operationCode);
post.timeout(5000);
post.timeout(30000);
post.body(body);
// 存入日志表
entity.setContent(body);
entity.setOperationCode(operationCode);
entity.setSendUrl(mengTianProperties.getHost() + url);
String resBody = "";
try {
HttpResponse execute = post.execute();
String resBody = execute.body();
resBody = execute.body();
log.info("推送工厂结果:{}", resBody);
JSONObject entries = JSONUtil.parseObj(resBody);
String resultCode = entries.getStr("Result");
entity.setResultContent(resBody);
entity.setSendStatus(StrUtil.isEmpty(resultCode) ? "0" : resultCode);
entity.setSendStatus(StrUtil.isEmpty(resultCode) ? "-1" : resultCode);
} catch (Exception e) {
entity.setResultContent(e.getMessage());
entity.setSendStatus("0");
entity.setResultContent(resBody);
entity.setSendStatus("-1");
}
factoryNodePushService.save(entity);
}

Loading…
Cancel
Save