Browse Source

数据量大的方案,发送zip文件到云中心

research/10.0
alex.sung 6 years ago
parent
commit
ca58fc5a81
  1. 16
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

16
designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

@ -240,6 +240,22 @@ public class InformationCollector implements XMLReadable, XMLWriter {
deleteFunctionRecords(currentTime);
}
}
// //先将发送压缩文件这段代码注释,之后提任务
//大数据量下发送压缩zip数据不容易丢失
// try {
// ObjectMapper objectMapper = new ObjectMapper();
// String contentStr = objectMapper.writeValueAsString(content);
// InputStream inputStream = new ByteArrayInputStream(contentStr.getBytes("UTF-8"));
// String recordUrl = url+"?token=" + SiteCenterToken.generateToken() + "&content="+ IOUtils.inputStream2Bytes(IOUtils.toZipIn(inputStream));
//
// String res = HttpToolbox.get(recordUrl);
// success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
// } catch (Exception e) {
// FineLoggerFactory.getLogger().error(e.getMessage(), e);
// }
// if (success) {
// deleteFunctionRecords(currentTime);
// }
}
private boolean sendFunctionRecord(String url, Map<String,Object> record) {

Loading…
Cancel
Save