队列过期时间

This commit is contained in:
2025-02-25 17:48:56 +08:00
parent 7a9742cad9
commit 6b4d9d6758

View File

@@ -25,7 +25,8 @@ public class RabbitConfig {
Map<String, Object> args = new HashMap<>();
// 设置消息过期时间为 180000 毫秒(即 180 秒)
args.put("x-message-ttl", 180000);
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, args);
// return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, args);
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, null);
}
@Bean