沙钢智慧能源系统后端代码
MQ
潘志宝
2024-12-11 250b37535c946ee1e04c67fcba8928f590618cd9
提交 | 用户 | 时间
8766cf 1 package com.iailab.module.shasteel.mq.config;
L 2
250b37 3 import com.iailab.module.shasteel.mq.common.RoutingConstant;
8766cf 4 import com.iailab.module.shasteel.mq.consumer.PredictFinishMessage;
L 5 import org.springframework.amqp.core.Binding;
6 import org.springframework.amqp.core.BindingBuilder;
7 import org.springframework.amqp.core.Queue;
8 import org.springframework.amqp.core.TopicExchange;
9 import org.springframework.context.annotation.Bean;
10 import org.springframework.context.annotation.Configuration;
11
12 /**
13  * @author lirm
14  * @Description
15  * @createTime 2024年11月27日
16  */
17 @Configuration
250b37 18 public class QueuePredictFinishConfig {
19     // 队列名称
20     public final static String QUEUE_NAME = "IaiabFastShateel.Model.PredictFinish";
8766cf 21
L 22     @Bean
23     public Queue predictFinishQueue() {
250b37 24         return new Queue(QueuePredictFinishConfig.QUEUE_NAME);
8766cf 25     }
L 26
27     @Bean
f0a800 28     TopicExchange predictFinishExchange() {
8766cf 29         return new TopicExchange(PredictFinishMessage.EXCHANGE);
L 30     }
31
32     // 注意通配符*和#的用法
33     @Bean
f0a800 34     Binding bindingExchangeMessagePF() {
250b37 35         return BindingBuilder.bind(predictFinishQueue()).to(predictFinishExchange()).with(RoutingConstant.Iailab_Model_PredictFinish);
8766cf 36     }
L 37 }