package com.xhkjedu.sexam.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.examImgMergeHandleQueue}")
    private String examImgMergeHandleQueue;
    @Value("${rabbitmq.examBaseToPdfHandleQueue}")
    private String examBaseToPdfHandleQueue;
    @Value("${rabbitmq.examBaseToScanImgHandleQueue}")
    private String examBaseToScanImgHandleQueue;
    @Value("${rabbitmq.examImgToPdfHandleQueue}")
    private String examImgToPdfHandleQueue;
    @Value("${rabbitmq.examHtmlToPdfHandleQueue}")
    private String examHtmlToPdfHandleQueue;

    //负载一生产者mq
    @Value("${rabbitmq.examImgMergeQueue}")
    private String examImgMergeQueue;
    @Value("${rabbitmq.examBaseToPdfQueue}")
    private String examBaseToPdfQueue;
    @Value("${rabbitmq.examBaseToScanImgQueue}")
    private String examBaseToScanImgQueue;
    @Value("${rabbitmq.examImgToPdfQueue}")
    private String examImgToPdfQueue;
    @Value("${rabbitmq.examHtmlToPdfQueue}")
    private String examHtmlToPdfQueue;

    //负载二生产者mq
    @Value("${rabbitmq.examImgMergeQueue2}")
    private String examImgMergeQueue2;
    @Value("${rabbitmq.examBaseToPdfQueue2}")
    private String examBaseToPdfQueue2;
    @Value("${rabbitmq.examBaseToScanImgQueue2}")
    private String examBaseToScanImgQueue2;
    @Value("${rabbitmq.examImgToPdfQueue2}")
    private String examImgToPdfQueue2;

    //消费者mq
    @Bean
    public Queue examImgMergeHandleQueue() {
        return new Queue(examImgMergeHandleQueue);
    }
    @Bean
    public Queue examBaseToPdfHandleQueue() {
        return new Queue(examBaseToPdfHandleQueue);
    }
    @Bean
    public Queue examBaseToScanImgHandleQueue(){ return new Queue(examBaseToScanImgHandleQueue);}
    @Bean
    public Queue examImgToPdfHandleQueue(){ return new Queue(examImgToPdfHandleQueue);}
    @Bean
    public Queue examHtmlToPdfHandleQueue(){ return new Queue(examHtmlToPdfHandleQueue);}

    //负载一生产者mq
    @Bean
    public Queue examImgMergeQueue() {
        return new Queue(examImgMergeQueue);
    }
    @Bean
    public Queue examBaseToPdfQueue() {
        return new Queue(examBaseToPdfQueue);
    }
    @Bean
    public Queue examBaseToScanImgQueue(){ return new Queue(examBaseToScanImgQueue);}
    @Bean
    public Queue examImgToPdfQueue(){ return new Queue(examImgToPdfQueue);}
    @Bean
    public Queue examHtmlToPdfQueue(){ return new Queue(examHtmlToPdfQueue);}

    //负载二生产者mq
    @Bean
    public Queue examImgMergeQueue2() {
        return new Queue(examImgMergeQueue2);
    }
    @Bean
    public Queue examBaseToPdfQueue2() {
        return new Queue(examBaseToPdfQueue2);
    }
    @Bean
    public Queue examBaseToScanImgQueue2(){ return new Queue(examBaseToScanImgQueue2);}
    @Bean
    public Queue examImgToPdfQueue2(){ return new Queue(examImgToPdfQueue2);}

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

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