fuliqi
2024-07-03 526745df87b382366960df1c765b83a84d493019
src/main/java/com/ycl/jxkg/rabbitmq/RabbitMQConfig.java
@@ -25,6 +25,11 @@
    @Autowired
    private ConnectionFactory connectionFactory;
    @Bean
    public DirectExchange examExchange() {
        return new DirectExchange("examExchange");
    }
    // 创建普通队列
    @Bean
    public Queue examQueue() {
@@ -34,6 +39,12 @@
        return new Queue("jxkg", true, false, false, args);
    }
    // 普通信队列到交换机
    @Bean
    public Binding binding(Queue examQueue, DirectExchange examExchange) {
        return BindingBuilder.bind(examQueue).to(examExchange).with("exam");
    }
    // 创建死信交换机
    @Bean
    public DirectExchange dlxExchange() {