| package doumeemes.config.rabbitmq; | 
|   | 
| import doumeemes.core.utils.Constants; | 
| 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.boot.SpringBootConfiguration; | 
| import org.springframework.context.annotation.Bean; | 
|   | 
| /** | 
|  * @author jiangping | 
|  *  * @date 2021-8-10 14:40:35 | 
|  */ | 
| //@SpringBootConfiguration | 
| public class RabbitmqConfig { | 
|     /** | 
|      * 测试 | 
|      * @return | 
|      */ | 
|     @Bean | 
|     public Queue queueTopic1() { | 
|         return new Queue(Constants.RabbitMqQueue.TEST); | 
|     } | 
|     /** | 
|      * 统计工单和计划的相关数量 | 
|      * @return | 
|      */ | 
|     @Bean | 
|     public Queue queueTopic2() { | 
|         return new Queue(Constants.RabbitMqQueue.QUEUE_STATISTIC); | 
|     } | 
|   | 
|     @Bean | 
|     public TopicExchange exchangeTopic() { | 
|         return new TopicExchange(Constants.MqTopicKeys.MQ_TOPIC); | 
|     } | 
|   | 
|     /* | 
|      * *  (星号) 用来表示一个单词 (必须出现的) | 
|      * #  (井号) 用来表示任意数量(零个或多个)单词 | 
|      */ | 
| //    @Bean | 
| /* | 
|     public Binding bindingTopic1() { | 
|         return BindingBuilder.bind(queueTopic1()).to(exchangeTopic()).with(Constants.MqTopicKeys.TOPIC_TEST); | 
|     } | 
|     @Bean | 
|     public Binding bindingTopic2() { | 
|         return BindingBuilder.bind(queueTopic2()).to(exchangeTopic()).with(Constants.MqTopicKeys.TOPIC_STATISTIC_NUM); | 
|     } | 
| */ | 
|   | 
| } |