| | |
| | | import cc.mrbird.febs.rabbit.constants.ExchangeConstants; |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import cc.mrbird.febs.rabbit.constants.RouteKeyConstants; |
| | | 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 cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.*; |
| | | import org.springframework.amqp.rabbit.connection.ConnectionFactory; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.factory.config.ConfigurableBeanFactory; |
| | |
| | | * @author wzy |
| | | * @date 2021-09-25 |
| | | **/ |
| | | @Slf4j |
| | | @Configuration |
| | | public class RabbitConfigure { |
| | | |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange defaultExchange() { |
| | | return new DirectExchange(ExchangeConstants.EXCHANGE_DEFAULT); |
| | | public DirectExchange pcCompanyAddExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.PC_COMPANY_ADD_ALI.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue defaultQueue() { |
| | | return new Queue(QueueConstants.QUEUE_DEFAULT); |
| | | public Queue pcCompanyAddQueue() { |
| | | return new Queue(RabbitQueueEnum.PC_COMPANY_ADD_ALI.getQueue()); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding defaultBind() { |
| | | return BindingBuilder.bind(defaultQueue()).to(defaultExchange()).with(RouteKeyConstants.ROUTE_KEY_DEFAULT); |
| | | public Binding pcCompanyAddBind() { |
| | | return BindingBuilder.bind(pcCompanyAddQueue()).to(pcCompanyAddExchange()).with(RabbitQueueEnum.PC_COMPANY_ADD_ALI.getRoute()); |
| | | } |
| | | } |