package com.xhkjedu.sstudy.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.resourceHandleQueue}")
    private String resourceHandleQueue;
    @Value("${rabbitmq.imgMergeHandleQueue}")
    private String imgMergeHandleQueue;

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

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

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

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

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

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

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