package cn.reghao.tnb.message.app.rabbit;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author reghao
 * @date 2024-11-28 15:34:05
 */
//@Component
public class RabbitDeclareConfig {
    @Bean
    public FanoutExchange fanoutExchange() {
        return new FanoutExchange("ws.fanout", true, false);
    }

    @Bean
    public Queue wsQueue() {
        return new Queue("ws.fanout.queue", true);
    }

    @Bean
    public Binding binding(Queue queue, Exchange exchange) {
        return BindingBuilder.bind(queue).to(exchange).with("").noargs();
    }
}
