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);

}
posted @ 2019-11-27 19:38  qing222  阅读(2037)  评论(0编辑  收藏  举报