RabbitConfiguration.java 884 B

123456789101112131415161718192021222324252627282930313233343536
  1. package cn.gygxzc.envir;
  2. import cn.gygxzc.tina.cloud.bus.constant.QueueName;
  3. import org.springframework.amqp.core.Queue;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.ComponentScan;
  6. import org.springframework.context.annotation.Configuration;
  7. /**
  8. * Created by niantuo on 2018/9/29.
  9. * rabbit配置.
  10. * 暂时对这个不了解,暂时使用自动配置结果
  11. * 注意分包方式。
  12. * 只要导入该包,即可自动配置,无需再用注解。
  13. */
  14. @Configuration
  15. @ComponentScan
  16. public class RabbitConfiguration {
  17. /***
  18. * 这个如果需要使用,改成自己项目的名称
  19. * @return 消息队列
  20. */
  21. @Bean
  22. public Queue frameworkQueue() {
  23. return new Queue(QueueName.Framework);
  24. }
  25. // @Bean
  26. // public Queue logQueue(){
  27. // return new Queue(QueueName.LOG);
  28. // }
  29. }