package cn.edu.zjvtit.cloudstorage.apiservice.rabbitmq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class TopicRabbitConfig {

    final static String apiMessage = "apiServers";//定义静态字符串api消息
    final static String dataMessage = "dataServers";//定义静态字符串data消息

    @Bean//实例化
    public Queue queueApi() {
        return new Queue(TopicRabbitConfig.apiMessage);
    }//返回新的api消息到队列里
    @Bean//实例化
    public Queue queueData() {
        return new Queue(TopicRabbitConfig.dataMessage);
    }//返回新的data消息到队列里
    @Bean//实例化
    TopicExchange exchange() {
        return new TopicExchange("exchange");
    }
    //返回新的主题交换机的模糊匹配
}