引入依赖在pom.xml中引入依赖spring-boot-starter-activemq生产者(producer) 和 消费者(consumer)都会用到的代码// 1.获取连接工厂 ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://127.0.0.1:61616"); // 2.创建连接对象 Connnection connection = factory.createConnection(); // 3.启动连接 connection.start(); // 4.创建会话 Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); // 5.创建消息类型(主题或者队列) Destination destination = session.createQueue("queue_style"); Destination destination = session.cr
Minghui
却道天凉好个秋!
CC BY-NC-SA 4.0