MqConfig.java 665 B

123456789101112131415161718192021222324252627
  1. package com.java110.order.mq;
  2. import org.apache.activemq.command.ActiveMQQueue;
  3. import org.apache.activemq.command.ActiveMQTopic;
  4. import org.springframework.boot.context.properties.ConfigurationProperties;
  5. import org.springframework.context.annotation.Bean;
  6. import javax.jms.Queue;
  7. import javax.jms.Topic;
  8. /**
  9. * Created by wuxw on 2017/4/17.
  10. */
  11. @ConfigurationProperties(prefix = "mq.queue.name",locations="classpath:mq/mq.properties")
  12. public class MqConfig {
  13. @Bean
  14. public Queue queue() {
  15. return new ActiveMQQueue("sample.queue");
  16. }
  17. @Bean
  18. public Topic deleteOrderTopic() {
  19. return new ActiveMQTopic("sample.topic");
  20. }
  21. }