package com.iailab.module.shasteel.mq.config;
|
|
import com.iailab.module.shasteel.mq.common.constant.RoutingConstant;
|
import org.springframework.amqp.core.Binding;
|
import org.springframework.amqp.core.BindingBuilder;
|
import org.springframework.amqp.core.Queue;
|
import org.springframework.amqp.core.TopicExchange;
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
|
/**
|
* @description: 电力预测完成消息队列
|
* @author: dzd
|
* @date: 2025/1/17 17:38
|
**/
|
@Configuration
|
public class QueueElecPredictFinishConfig {
|
// 队列名称
|
public final static String QUEUE_NAME = "IaiabFastShateel.Model.PredictFinish.Elec";
|
|
@Bean
|
public Queue predictFinishQueue() {
|
return new Queue(QueueElecPredictFinishConfig.QUEUE_NAME);
|
}
|
|
@Bean
|
TopicExchange predictFinishExchange() {
|
return new TopicExchange(RoutingConstant.EXCHANGE);
|
}
|
|
// 注意通配符*和#的用法
|
@Bean
|
Binding bindingExchangeMessagePF() {
|
return BindingBuilder.bind(predictFinishQueue()).to(predictFinishExchange()).with(RoutingConstant.Iailab_Model_PredictFinish_Elec);
|
}
|
}
|