资源简介
中间件技术 实验三 消息中间件应用开发: - CSDN博客 https://blog.csdn.net/lly1122334/article/details/80139790
代码片段和文件信息
package example1;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import org.apache.activemq.ActiveMQConnectionFactory;
public class Consumer {
private static String brokerURL = “tcp://localhost:61616“;
private static transient ConnectionFactory factory;
private transient Connection connection;
private transient Session session;
public Consumer() throws JMSException {
factory = new ActiveMQConnectionFactory(brokerURL);
connection = factory.createConnection();
connection.start();
session = connection.createSession(false Session.AUTO_ACKNOWLEDGE);
}
public void close() throws JMSException {
if (connection != null) {
connection.close();
}
}
public static void main(String[] args) throws JMSException {
Consumer consumer = new Consumer();
String[] stocks = {“ORCL“};
for (String stock : stocks) {
Destination destination = consumer.getSession().createTopic(“STOCKS.“ + stock);
MessageConsumer messageConsumer = consumer.getSession().createConsumer(destination);
messageConsumer.setMessageListener(new Listener());
}
}
public Session getSession() {
return session;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 366 2016-04-13 09:19 MessageMiddleWare\.classpath
文件 393 2016-04-13 07:59 MessageMiddleWare\.project
文件 598 2016-04-13 09:04 MessageMiddleWare\.settings\org.eclipse.jdt.core.prefs
文件 2154 2016-04-13 09:29 MessageMiddleWare\bin\example1\Consumer.class
文件 1689 2016-04-13 09:19 MessageMiddleWare\bin\example1\Listener.class
文件 4584 2016-04-13 09:29 MessageMiddleWare\bin\example1\Publisher.class
文件 2475 2016-04-13 09:19 MessageMiddleWare\bin\example2\Receiver.class
文件 2835 2016-04-13 09:19 MessageMiddleWare\bin\example2\Sender.class
文件 2899 2016-04-13 09:19 MessageMiddleWare\bin\example3\MessageReceiver.class
文件 3177 2016-04-13 09:19 MessageMiddleWare\bin\example3\MessageSender.class
文件 900 2016-04-13 09:19 MessageMiddleWare\bin\example3\MyActiveMQDemo.class
文件 3834031 2011-10-12 10:02 MessageMiddleWare\lib\activemq-all-5.4.3.jar
文件 1556 2016-04-13 09:29 MessageMiddleWare\src\example1\Consumer.java
文件 845 2016-04-13 08:48 MessageMiddleWare\src\example1\Listener.java
文件 4002 2016-04-13 09:29 MessageMiddleWare\src\example1\Publisher.java
文件 2205 2016-04-13 09:08 MessageMiddleWare\src\example2\Receiver.java
文件 2756 2016-04-13 09:08 MessageMiddleWare\src\example2\Sender.java
文件 2322 2016-04-13 09:11 MessageMiddleWare\src\example3\MessageReceiver.java
文件 2593 2016-04-13 09:10 MessageMiddleWare\src\example3\MessageSender.java
文件 452 2016-04-13 09:11 MessageMiddleWare\src\example3\MyActiveMQDemo.java
目录 0 2016-04-13 09:19 MessageMiddleWare\bin\example1
目录 0 2016-04-13 09:19 MessageMiddleWare\bin\example2
目录 0 2016-04-13 09:19 MessageMiddleWare\bin\example3
目录 0 2016-04-13 08:48 MessageMiddleWare\src\example1
目录 0 2016-04-13 09:08 MessageMiddleWare\src\example2
目录 0 2016-04-13 09:11 MessageMiddleWare\src\example3
目录 0 2016-04-13 07:59 MessageMiddleWare\.settings
目录 0 2016-04-13 09:19 MessageMiddleWare\bin
目录 0 2016-04-13 09:19 MessageMiddleWare\lib
目录 0 2016-04-13 09:12 MessageMiddleWare\src
............此处省略4个文件信息
相关资源
- springBoot2.0.1、zookeeper、dubbo、activemq、
- apache-activemq-5.12.0-bin.tar.gz
- Spring和ActiveMQ整合的完整
- 用VS2008编译好的activemq-cpp3.8.3库,含源
- SpringBoot整合ActiveMQ消息队列和双向队
- activemq的安装
- apache-activemq-5.13.1-bin.tar.gz
- apache-activemq-5.13.0-bin.tar.gz
- activemqC开发
- springboot-tio-activemq.rar整合SpringBoot实现
- SpringBoot使用JMS的小ActiveMQ实现
- activeMQ从入门到精通视频教程
- activemq 入门
- ActiveMQ中文文档.pdf
- qt activemq mqtt 动态库
- SpringBoot整合ActiveMQ(消息中间件)实
- MSMQ、RabbitMQ、ActiveMQ消息队列调试工具
- SpringBoot+ActiveMq+MQTT实现消息的发送和
- 消息中间件项目
- SpringActiveMQ
- activemqdubbolinuxredisshirosolr笔记整合,基
评论
共有 条评论