dengsixing 2 年之前
父節點
當前提交
2ee4ea69a9

+ 3 - 3
src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java

@@ -43,13 +43,13 @@ public class RabbitMqListener {
         queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
     )
     public void transferTourVideo(Channel channel, Message message) throws Exception {
-        String correlation = (String)message.getMessageProperties().getHeader("spring_returned_message_correlation");
+        String messageId = message.getMessageProperties().getMessageId();
         String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-        log.info("开始消费消息,id:{},queue:{},content:{}", correlation, downloadTourVideoQueue, msg);
+        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, downloadTourVideoQueue, msg);
         DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
         downloadTourVideoService.transferTourVideo(downloadTourVideo);
         channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-        log.info("结束消费消息,id:{}", correlation);
+        log.info("结束消费消息,id:{}", messageId);
     }
 
 

+ 3 - 0
src/main/java/com/fdkankan/scene/service/impl/DownloadTourVideoServiceImpl.java

@@ -104,6 +104,9 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
 
         String destPath = null;
         try {
+
+            Thread.sleep(20000);
+
             String destFileName = UUID.randomUUID().toString() + ".mp4";
             destPath = ConstantFilePath.SCENE_V4_PATH + downloadTourVideo.getNum() + "/tour/" + destFileName;
             File destFile = new File(destPath);