| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | |
| | | */ |
| | | private String routingKeyName; |
| | | |
| | | /** |
| | | * AI返回结果队列 |
| | | */ |
| | | private String AIEvaluationResults; |
| | | |
| | | /** |
| | | * 骨龄评价统计 |
| | | */ |
| | | private String BoneAgeEvaluationData; |
| | | |
| | | /** |
| | | * 档案统计 |
| | | */ |
| | | private String ChildRecordData; |
| | | |
| | | /** |
| | | * 报告统计 |
| | | */ |
| | | private String ReportData; |
| | | |
| | | @Bean |
| | | public ConnectionFactory connectionFactory() { |
| | | CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host,port); |
| | | CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host, port); |
| | | connectionFactory.setUsername(username); |
| | | connectionFactory.setPassword(password); |
| | | connectionFactory.setVirtualHost(virtualHost); |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public Queue AIEvaluationResults() { |
| | | return new Queue(AIEvaluationResults); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue BoneAgeEvaluationData() { |
| | | return new Queue(BoneAgeEvaluationData); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue ChildRecordData() { |
| | | return new Queue(ChildRecordData); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public Queue ReportData() { |
| | | return new Queue(ReportData); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | Binding bindingExchangeAIEvaluation(TopicExchange exchange) { |
| | | return BindingBuilder.bind(AIEvaluation()).to(exchange).with(routingKeyName); |
| | | } |
| | |
| | | Binding bindingExchangeAdvancedEvaluation(TopicExchange exchange) { |
| | | return BindingBuilder.bind(AdvancedEvaluation()).to(exchange).with(routingKeyName); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public CustomExchange delayExchange(){ |
| | | Map<String, Object> args = new HashMap<>(16); |
| | | args.put("x-delayed-type", "direct"); |
| | | //属性参数 交换机名称 交换机类型 是否持久化 是否自动删除 配置参数 |
| | | return new CustomExchange("kagDelayExchange", "x-delayed-message", true, false, args); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列D |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Queue delayQueue(){ |
| | | //属性参数 队列名称 是否持久化 |
| | | return new Queue("kagMessageDelayQueue", true); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询 |
| | | * 延时队列绑定交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Binding cfgDelayBinding(){ |
| | | return BindingBuilder.bind(delayQueue()).to(delayExchange()).with("kagMessageDelayKey").noargs(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列--更改待完成状态 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Queue delayUncompletedQueue(){ |
| | | //属性参数 队列名称 是否持久化 |
| | | return new Queue("kagAdvisoryNncompletedDelayQueue", true); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询 |
| | | * 给延时队列绑定交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Binding delayBinding(){ |
| | | return BindingBuilder.bind(delayQueue()).to(delayExchange()).with("kagAdvisoryUncompletedDelayKey").noargs(); |
| | | } |
| | | } |