package org.springblade.common.config.mq;

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

/**
 * @author: lianghanqiang
 * @description:
 * @since: 10/25/21 -- 2:29 PM
 */
//@Configuration
public class RabbitConfig {

	@Bean
	public Queue TestDirectQueue() {
		return new Queue("LogDirectQueue", true);
	}

	@Bean
	DirectExchange TestDirectExchange() {
		return new DirectExchange("LogDirectExchange", true, false);
	}

	@Bean
	Binding bindingDirect() {
		return BindingBuilder.bind(TestDirectQueue()).to(TestDirectExchange()).with("LogDirectRouting");
	}

	@Bean
	DirectExchange lonelyDirectExchange() {
		return new DirectExchange("lonelyDirectExchange");
	}
}

