package com.ai.da.common.RabbitMQ;

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

@Configuration
public class MQConfig {

    public static final String GENERATE_EXCHANGE_FANOUT = "generate-exchange";
    //    public static final String GENERATE_QUEUE = "generate-queue-prod";
//    public static final String GENERATE_QUEUE = "generate-queue-test";
    public static final String GENERATE_QUEUE = "generate-queue-dev";
//    public static final String GENERATE_QUEUE = "generate-queue-local";

        public static final String SR_QUEUE = "SR-queue-dev";
//    public static final String SR_QUEUE = "SR-queue-local";

//        public static final String SR_RESULT_QUEUE = "SuperResolution-local";
    public static final String SR_RESULT_QUEUE = "SuperResolution-dev";

    public MQConfig() {
    }

//    @Bean
//    FanoutExchange fanoutRasaExchange() {
//        return new FanoutExchange(GENERATE_EXCHANGE_FANOUT);
//    }

    /**
     * 创建队列,使用工作模式，不用定义交换机
     */
    @Bean
    public Queue generateQueue() {
        return new Queue(GENERATE_QUEUE);
    }

    @Bean
    public Queue SRQueue() {
        return new Queue(SR_QUEUE);
    }

    @Bean
    public Queue SRResultQueue() {
        return new Queue(SR_RESULT_QUEUE);
    }

    /**
     * 将队列绑定到交换机上【队列订阅交换机】
     */
//    @Bean
//    Binding bindingExchangeRasa() {
//        return BindingBuilder.bind(queueRasa()).to(fanoutRasaExchange());
//    }

}
