沙钢智慧能源系统后端代码
潘志宝
2025-01-20 120abc8092ea044a6e79aab24a7de05d1309d414
shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/QueuePredictFinishConfig.java
@@ -1,7 +1,6 @@
package com.iailab.module.shasteel.mq.config;
import com.iailab.module.shasteel.mq.common.RoutingConstant;
import com.iailab.module.shasteel.mq.consumer.PredictFinishMessage;
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;
@@ -19,14 +18,21 @@
    // 队列名称
    public final static String QUEUE_NAME = "IaiabFastShateel.Model.PredictFinish";
    public final static String QUEUE_NAME_ELEC = "IaiabFastShateel.Model.PredictFinish.Elec";
    @Bean
    public Queue predictFinishQueue() {
        return new Queue(QueuePredictFinishConfig.QUEUE_NAME);
    }
    @Bean
    public Queue predictFinishQueueElec() {
        return new Queue(QueuePredictFinishConfig.QUEUE_NAME_ELEC);
    }
    @Bean
    TopicExchange predictFinishExchange() {
        return new TopicExchange(PredictFinishMessage.EXCHANGE);
        return new TopicExchange(RoutingConstant.EXCHANGE);
    }
    // 注意通配符*和#的用法
@@ -34,4 +40,9 @@
    Binding bindingExchangeMessagePF() {
        return BindingBuilder.bind(predictFinishQueue()).to(predictFinishExchange()).with(RoutingConstant.Iailab_Model_PredictFinish);
    }
    @Bean
    Binding bindingExchangeMessageElec() {
        return BindingBuilder.bind(predictFinishQueueElec()).to(predictFinishExchange()).with(RoutingConstant.Iailab_Model_PredictFinish_Elec);
    }
}