Commit 6a45cc04 by xmh

<feat> 推送成功后打印日志

1 parent c142d2fc
......@@ -67,6 +67,7 @@ public class ForwardWriter implements ItemWriter<ForwardContent> {
.retrieve()
.bodyToMono(String.class);
String block = response.block(Duration.ofSeconds(20));
log.info("数据推送完成,对接名称:[{}],结果:[{}]", forward.getName(), block);
} catch (Exception e) {
failed += 1;
if (failed == 3) {
......
......@@ -101,16 +101,9 @@ public class DataReceiveController {
param.add("refid", videoResult.getRefid());
param.add("format", videoResult.getFormat());
param.add("file", new FileSystemResource(file));
Mono<String> response = WebClientUtils.buildClient(null)
.post()
.uri(forward.getUrl())
.contentType(MediaType.MULTIPART_FORM_DATA)
.contentLength(file.length())
.body(BodyInserters.fromMultipartData(param))
.retrieve()
.bodyToMono(String.class);
Mono<String> response = WebClientUtils.buildClient(null).post().uri(forward.getUrl()).contentType(MediaType.MULTIPART_FORM_DATA).contentLength(file.length()).body(BodyInserters.fromMultipartData(param)).retrieve().bodyToMono(String.class);
String block = response.block(Duration.ofSeconds(10));
log.info("发送视频文件完成,结果:{}", block);
log.info("发送视频文件完成,对接名称:[{}],结果:[{}]", forward.getName(), block);
} catch (Exception e) {
log.error("发送视频文件失败", e);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!