TASK:generate 修复逻辑Bug

This commit is contained in:
2024-01-25 13:37:17 +08:00
parent 65bed9dada
commit c35a188abb
7 changed files with 75 additions and 44 deletions

View File

@@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
public class MQConfig {
public static final String GENERATE_EXCHANGE_FANOUT = "generate-exchange";
public static final String GENERATE_QUEUE = "generate-queue";
public static final String GENERATE_QUEUE = "generate-queue-prod";
public MQConfig() {
}

View File

@@ -63,12 +63,12 @@ public class MQConsumer {
// 2.2 将该消息从取消列表中删除
// redisUtil.removeFromSet(cancelSetKey, uniqueId);
} else {
/*try {
Thread.sleep(15000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}*/
GenerateCollectionVO generateCollectionVO = generateService.generateThroughImageText(generateThroughImageTextDTO);
// try {
// Thread.sleep(15000);
// } catch (InterruptedException e) {
// throw new RuntimeException(e);
// }
// 将消息从redis排队队列中删除,需保证被消费的消息存储到db之后再从redis删除
redisUtil.removeFromZSet(consumptionOrderKey, uniqueId);
if (!Objects.isNull(generateCollectionVO)) {
@@ -100,8 +100,8 @@ public class MQConsumer {
}
long end = System.currentTimeMillis();
log.info(" task_id " + uniqueId + "----------" + consumerName + " 执行时长:" + (end - start) + "毫秒");
log.info("============end listening==========");
log.info(" task_id " + uniqueId + "----------" + consumerName + " 执行时长:" + (end - start) + "毫秒");
log.info("=============end listening===========");
}
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)