| | |
| | | private ConnectionFactory connectionFactory; |
| | | |
| | | @Bean |
| | | public DirectExchange examExchange() { |
| | | return new DirectExchange("examExchange"); |
| | | public DirectExchange jxkgExchange() { |
| | | return new DirectExchange("jxkgExchange"); |
| | | } |
| | | |
| | | // 创建普通队列 |
| | | // 创建考试普通队列 |
| | | @Bean |
| | | public Queue examQueue() { |
| | | Map<String, Object> args = new HashMap<>(); |
| | | // 设置死信交换机 |
| | | args.put("x-dead-letter-exchange", "dlxExchange"); |
| | | return new Queue("jxkg", true, false, false, args); |
| | | return new Queue("exam", true, false, false, args); |
| | | } |
| | | |
| | | // 普通信队列到交换机 |
| | | // 创建会议普通队列 |
| | | @Bean |
| | | public Binding binding(Queue examQueue, DirectExchange examExchange) { |
| | | return BindingBuilder.bind(examQueue).to(examExchange).with("exam"); |
| | | public Queue meetQueue() { |
| | | Map<String, Object> args = new HashMap<>(); |
| | | // 设置死信交换机 |
| | | args.put("x-dead-letter-exchange", "dlxExchange"); |
| | | return new Queue("meet", true, false, false, args); |
| | | } |
| | | |
| | | // 考试普通信队列到交换机 |
| | | @Bean |
| | | public Binding binding(Queue examQueue, DirectExchange jxkgExchange) { |
| | | return BindingBuilder.bind(examQueue).to(jxkgExchange).with("exam"); |
| | | } |
| | | |
| | | // 会议普通信队列到交换机 |
| | | @Bean |
| | | public Binding binding2(Queue meetQueue, DirectExchange jxkgExchange) { |
| | | return BindingBuilder.bind(meetQueue).to(jxkgExchange).with("meet"); |
| | | } |
| | | // 创建死信交换机 |
| | | @Bean |
| | | public DirectExchange dlxExchange() { |