| | |
| | | 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 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; |
| | |
| | | return new RabbitTemplate(connectionFactory); |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange defaultExchange() { |
| | | return new DirectExchange(ExchangeConstants.EXCHANGE_DEFAULT); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue defaultQueue() { |
| | | return new Queue(QueueConstants.QUEUE_DEFAULT); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding defaultBind() { |
| | | return BindingBuilder.bind(defaultQueue()).to(defaultExchange()).with(RouteKeyConstants.ROUTE_KEY_DEFAULT); |
| | | } |
| | | } |