添加考试周时长
This commit is contained in:
@@ -64,6 +64,11 @@ public class DelayQueueConfig {
|
||||
public static final String COURSE_EXCHANGE = "course_exchange";
|
||||
public static final String COURSE_ROUTING_KEY = "course_routingKey";
|
||||
|
||||
//通用队列
|
||||
public static final String COMMON_QUEUE = "common_queue";
|
||||
public static final String COMMON_EXCHANGE = "common_exchange";
|
||||
public static final String COMMON_ROUTING_KEY = "common_routingKey";
|
||||
|
||||
/**
|
||||
* 快递队列
|
||||
*/
|
||||
@@ -248,7 +253,6 @@ public class DelayQueueConfig {
|
||||
.noargs();
|
||||
}
|
||||
|
||||
|
||||
//课程过期延迟队列
|
||||
@Bean
|
||||
public Queue courseQueue() {
|
||||
@@ -270,6 +274,27 @@ public class DelayQueueConfig {
|
||||
.noargs();
|
||||
}
|
||||
|
||||
//通用延迟队列
|
||||
@Bean
|
||||
public Queue commonQueue() {
|
||||
return new Queue(COMMON_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public CustomExchange commonExchange() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
//自定义交换机的类型
|
||||
args.put("x-delayed-type", "direct");
|
||||
return new CustomExchange(COMMON_EXCHANGE, "x-delayed-message", true, false,args);
|
||||
}
|
||||
@Bean
|
||||
public Binding commonBinding() {
|
||||
return BindingBuilder
|
||||
.bind(commonQueue())
|
||||
.to(commonExchange())
|
||||
.with(COMMON_ROUTING_KEY)
|
||||
.noargs();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user