修改课程、会员延迟队列
This commit is contained in:
@@ -54,13 +54,15 @@ public class DelayQueueConfig {
|
||||
public static final String ORDER_CANCEL_DEAD_LETTER_QUEUE = "order_cancel_dead_letter_queue";
|
||||
|
||||
|
||||
//超V过期队列+死信
|
||||
//超V过期延迟队列
|
||||
public static final String USERVIP_QUEUE = "uservip_queue";
|
||||
public static final String USERVIP_EXCHANGE = "uservip_exchange";
|
||||
public static final String USERVIP_ROUTING_KEY = "uservip_routingKey";
|
||||
public static final String USERVIP_DEAD_LETTER_QUEUE = "uservip_dead_letter_queue";
|
||||
public static final String USERVIP_DEAD_LETTER_EXCHANGE = "uservip_dead_letter_exchange";
|
||||
public static final String USERVIP_DEAD_LETTER_ROUTING_KEY = "uservip_dead_letter_routingKey";
|
||||
|
||||
//课程过期延迟队列
|
||||
public static final String COURSE_QUEUE = "course_queue";
|
||||
public static final String COURSE_EXCHANGE = "course_exchange";
|
||||
public static final String COURSE_ROUTING_KEY = "course_routingKey";
|
||||
|
||||
/**
|
||||
* 快递队列
|
||||
@@ -225,44 +227,51 @@ public class DelayQueueConfig {
|
||||
.with(ORDER_CANCEL_DEAD_LETTER_ROUTING_KEY);
|
||||
}
|
||||
|
||||
//超V过期队列+死信
|
||||
//超V过期延迟队列
|
||||
@Bean
|
||||
public Queue uservipQueue() {
|
||||
Map<String, Object> arguments = new HashMap<>(2);
|
||||
// 绑定死信交换机
|
||||
arguments.put("x-dead-letter-exchange", USERVIP_DEAD_LETTER_EXCHANGE);
|
||||
// 绑定我们的路由key
|
||||
arguments.put("x-dead-letter-routing-key", USERVIP_DEAD_LETTER_ROUTING_KEY);
|
||||
return new Queue(USERVIP_QUEUE, true, false, false, arguments);
|
||||
return new Queue(USERVIP_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public DirectExchange uservipExchange() {
|
||||
return new DirectExchange(USERVIP_EXCHANGE);
|
||||
public CustomExchange uservipExchange() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
//自定义交换机的类型
|
||||
args.put("x-delayed-type", "direct");
|
||||
return new CustomExchange(USERVIP_EXCHANGE, "x-delayed-message", true, false,args);
|
||||
}
|
||||
@Bean
|
||||
public Binding uservipBinding() {
|
||||
return BindingBuilder
|
||||
.bind(uservipQueue())
|
||||
.to(uservipExchange())
|
||||
.with(USERVIP_ROUTING_KEY);
|
||||
.with(USERVIP_ROUTING_KEY)
|
||||
.noargs();
|
||||
}
|
||||
|
||||
|
||||
//课程过期延迟队列
|
||||
@Bean
|
||||
public Queue courseQueue() {
|
||||
return new Queue(COURSE_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public Queue uservipDeadLetterQueue() {
|
||||
return new Queue(USERVIP_DEAD_LETTER_QUEUE);
|
||||
public CustomExchange courseExchange() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
//自定义交换机的类型
|
||||
args.put("x-delayed-type", "direct");
|
||||
return new CustomExchange(COURSE_EXCHANGE, "x-delayed-message", true, false,args);
|
||||
}
|
||||
@Bean
|
||||
public DirectExchange uservipDeadLetterExchange() {
|
||||
return new DirectExchange(USERVIP_DEAD_LETTER_EXCHANGE);
|
||||
}
|
||||
@Bean
|
||||
public Binding uservipDeadBinding() {
|
||||
public Binding courseBinding() {
|
||||
return BindingBuilder
|
||||
.bind(uservipDeadLetterQueue())
|
||||
.to(uservipDeadLetterExchange())
|
||||
.with(USERVIP_DEAD_LETTER_ROUTING_KEY);
|
||||
.bind(courseQueue())
|
||||
.to(courseExchange())
|
||||
.with(COURSE_ROUTING_KEY)
|
||||
.noargs();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue FMSQueue() {
|
||||
return new Queue(FMS_QUEUE);
|
||||
|
||||
Reference in New Issue
Block a user