rabbitmq设置队列消息存活时间

public static final int ALIVETIME = 600000;
public static final String QUEUE = "hnyz_gs_queue";

@Bean
public Queue cretaeQueue(){
// return new Queue(QUEUE,true);
Map<String, Object> argMap = new HashMap<>();
// 设置消息存活时间
argMap.put("x-message-ttl",ALIVETIME);
return new Queue(QUEUE, true, false, false, argMap);

}

猜你喜欢

转载自www.cnblogs.com/sung1024/p/11944934.html