1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package cn.gygxzc.envir.bus;
- import cn.gygxzc.tina.cloud.bus.constant.QueueName;
- import cn.gygxzc.tina.cloud.bus.framweork.receiver.LoggerReceiver;
- import cn.gygxzc.tina.cloud.bus.messager.sender.IMessagerSender;
- import cn.gygxzc.tina.cloud.bus.messager.sender.impl.MessagerSender;
- import org.springframework.amqp.core.AmqpTemplate;
- import org.springframework.amqp.core.Queue;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframework.context.annotation.Configuration;
- /**
- * Created by niantuo on 2018/9/29.
- * rabbit配置.
- * 暂时对这个不了解,暂时使用自动配置结果
- * 注意分包方式。
- * 只要导入该包,即可自动配置,无需再用注解。
- */
- @Configuration
- @ComponentScan
- public class RabbitConfiguration {
- /***
- * 这个如果需要使用,改成自己项目的名称
- * @return 消息队列
- */
- @Bean
- public Queue frameworkQueue() {
- return new Queue(QueueName.Framework);
- }
- @Bean
- public IMessagerSender messagerSender(AmqpTemplate template){
- return new MessagerSender(template);
- }
- // @Bean
- // public Queue logQueue(){
- // return new Queue(QueueName.LOG);
- // }
- //
- //
- // @Bean
- // public LoggerReceiver loggerReceiver(){
- // return new LoggerReceiver();
- // }
- }
|