浏览代码

v4.9.0 修改getauth接口中计算目录过期被删除返回资源失效状态逻辑

dsx 2 年之前
父节点
当前提交
5a48b90d9e
共有 2 个文件被更改,包括 79 次插入79 次删除
  1. 77 77
      src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java
  2. 2 2
      src/main/resources/bootstrap-test.yml

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

@@ -1,77 +1,77 @@
-//package com.fdkankan.scene.listener;
-//
-//import com.alibaba.fastjson.JSON;
-//import com.fdkankan.scene.entity.DownloadTourVideo;
-//import com.fdkankan.scene.service.IDownloadTourVideoService;
-//import com.rabbitmq.client.Channel;
-//import java.nio.charset.StandardCharsets;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.amqp.core.Message;
-//import org.springframework.amqp.rabbit.annotation.Queue;
-//import org.springframework.amqp.rabbit.annotation.RabbitListener;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.stereotype.Component;
-//
-///**
-// * <p>
-// * TODO
-// * </p>
-// *
-// * @author dengsixing
-// * @since 2022/4/19
-// **/
-//@Slf4j
-//@Component
-//public class RabbitMqListener {
-//
-//    @Value("${queue.scene.transfer-tour-video}")
-//    private String downloadTourVideoQueue;
-//
-//    @Autowired
-//    private IDownloadTourVideoService downloadTourVideoService;
-//
-//
-//
-//
-//    /**
-//     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
-//     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
-//     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
-//     */
-//    @RabbitListener(
-//        queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
-//    )
-//    public void transferTourVideo(Channel channel, Message message) throws Exception {
-//        String messageId = message.getMessageProperties().getMessageId();
-//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-//        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, downloadTourVideoQueue, msg);
-//        DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
-//        downloadTourVideoService.transferTourVideo(downloadTourVideo);
-//        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
-//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//        log.info("结束消费消息,id:{}", messageId);
-//    }
-//
-//    /**
-//     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
-//     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
-//     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
-//     */
-//    @RabbitListener(
-//        queuesToDeclare = @Queue("test_dsx")
-//    )
-//    public void test(Channel channel, Message message) throws Exception {
-//        String messageId = message.getMessageProperties().getMessageId();
-//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "test_dsx", msg);
-//        Thread.sleep(10000L);
-//        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
-//        log.info("结束消费消息,id:{}", messageId);
-//    }
-//
-//
-//
-//
-//}
+package com.fdkankan.scene.listener;
+
+import com.alibaba.fastjson.JSON;
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
+import com.rabbitmq.client.Channel;
+import java.nio.charset.StandardCharsets;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/19
+ **/
+@Slf4j
+@Component
+public class RabbitMqListener {
+
+    @Value("${queue.scene.transfer-tour-video}")
+    private String downloadTourVideoQueue;
+
+    @Autowired
+    private IDownloadTourVideoService downloadTourVideoService;
+
+
+
+
+    /**
+     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
+     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
+     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
+     */
+    @RabbitListener(
+        queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
+    )
+    public void transferTourVideo(Channel channel, Message message) throws Exception {
+        String messageId = message.getMessageProperties().getMessageId();
+        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, downloadTourVideoQueue, msg);
+        DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
+        downloadTourVideoService.transferTourVideo(downloadTourVideo);
+        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
+        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        log.info("结束消费消息,id:{}", messageId);
+    }
+
+    /**
+     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
+     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
+     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
+     */
+    @RabbitListener(
+        queuesToDeclare = @Queue("test_dsx")
+    )
+    public void test(Channel channel, Message message) throws Exception {
+        String messageId = message.getMessageProperties().getMessageId();
+        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "test_dsx", msg);
+        Thread.sleep(10000L);
+        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
+        log.info("结束消费消息,id:{}", messageId);
+    }
+
+
+
+
+}

+ 2 - 2
src/main/resources/bootstrap-test.yml

@@ -29,8 +29,8 @@ spring:
             group: DEFAULT_GROUP
             refresh: true
       discovery:
-#        namespace: ${spring.cloud.nacos.namespace}
-        namespace: public
+        namespace: ${spring.cloud.nacos.namespace}
+#        namespace: public