package com.xhkjedu.sapi.config;

import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ywx
 * @classname RabbitConfig
 * @description
 * @date 2021/6/18 12:51
 **/
@Configuration
public class RabbitConfig {
    //消费者mq
    @Value("${rabbitmq.researchHandleQueue}")
    private String researchHandleQueue;

    //负载一生产者mq
    @Value("${rabbitmq.researchTransferQueue}")
    private String researchTransferQueue;
    @Value("${rabbitmq.resourceDelQueue}")
    private String resourceDelQueue;

    //负载二生产者mq
    @Value("${rabbitmq.researchTransferQueue2}")
    private String researchTransferQueue2;
    @Value("${rabbitmq.resourceDelQueue2}")
    private String resourceDelQueue2;

    //消费者mq
    @Bean
    public Queue researchHandleQueue() {
        return new Queue(researchHandleQueue);
    }

    //负载一生产者mq
    @Bean
    public Queue researchTransferQueue() {
        return new Queue(researchTransferQueue);
    }
    @Bean
    public Queue resourceDelQueue() {
        return new Queue(resourceDelQueue);
    }

    //负载二生产者mq
    @Bean
    public Queue researchTransferQueue2() {
        return new Queue(researchTransferQueue2);
    }
    @Bean
    public Queue resourceDelQueue2() {
        return new Queue(resourceDelQueue2);
    }

    //生产者mq-操作日志
    @Value("${rabbitmq.handleLogQueue}")
    private String handleLogQueue;

    @Bean
    public Queue handleLogQueue() {
        return new Queue(handleLogQueue);
    }
}
