- 浏览: 7253723 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
package easyway.activemq.app.demo4; import java.util.Date; import javax.jms.JMSException; import javax.jms.MapMessage; import javax.jms.Message; import javax.jms.Session; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.core.MessageCreator; /** * 消息发送者 * @author longgangbai * */ public class MessageSender { public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("activemq-pool-jdbc.xml"); JmsTemplate jmsTemplate = (JmsTemplate) ctx.getBean("jmsTemplate"); jmsTemplate.send(new MessageCreator() { public Message createMessage(Session session) throws JMSException { MapMessage mm = session.createMapMessage(); mm.setLong("count", new Date().getTime()); return mm; } }); } }
package easyway.activemq.app.demo4; import java.util.Date; import java.util.Map; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.jms.core.JmsTemplate; /** * 消息发送者 * @author longgangbai * */ public class MessageReceiver { @SuppressWarnings("unchecked") public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("activemq-pool-jdbc.xml"); JmsTemplate jmsTemplate = (JmsTemplate) ctx.getBean("jmsTemplate"); while(true) { Map<String, Object> mm = (Map<String, Object>) jmsTemplate.receiveAndConvert(); System.out.println("收到消息:" + new Date((Long)mm.get("count"))); } } }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>tcp://localhost:61616</value> </property> </bean> <bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop"> <property name="connectionFactory"> <ref bean="connectionFactory"/> </property> <property name="idleTimeout"> <value>2000</value> </property> <property name="maxConnections"> <value>10</value> </property> </bean> <bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg index="0"> <value>tomcatqueue</value> </constructor-arg> </bean> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory"> <ref bean="jmsFactory"/> </property> <property name="defaultDestination"> <ref bean="destination"/> </property> <property name="messageConverter"> <bean class="org.springframework.jms.support.converter.SimpleMessageConverter"/> </property> </bean> </beans>
评论
2 楼
longgangbai
2011-12-10
我想用代码方式设置,找不到这个类
activemq-pool.jar这个jar包中。请到官方下载最新5.x版本都包含这个jar文件
maishj 写道
想请问下 org.apache.activemq.pool.PooledConnectionFactory 在哪个jar包,我想用代码方式设置,找不到这个类
activemq-pool.jar这个jar包中。请到官方下载最新5.x版本都包含这个jar文件
1 楼
maishj
2011-12-07
想请问下 org.apache.activemq.pool.PooledConnectionFactory 在哪个jar包,我想用代码方式设置,找不到这个类
发表评论
-
ActiveMQ的拦截器插件
2011-07-22 09:29 6498ActiveMQ拦截器使用和原 ... -
ActiveMQ的各种表SQL的管理
2011-07-20 20:58 3401在ActiveMQ为了方便的切换数据库,更为了深入 ... -
ActiveMQ中advisory的使用和原理
2011-07-20 18:46 2855在ActiveMQ中的监控和管理也可以通过Advisory实现 ... -
ActiveMQ的异步转发(DispatchAsync)功能
2011-07-20 11:29 46591. 消息者异步转发功能 针对正常情况下,在一个 ... -
ActiveMQ 的独占消费(Exclusive Consumer)
2011-07-20 11:26 4054我们经常希望维持队列中的消息,按一定次序转发给消息者。然而当有 ... -
ActiveMQ5.5在Tomcat6.0中部署
2011-07-19 22:27 2886在ActiveMQ中监控管理Web组件为ActiveMQCon ... -
Window 下ActiveMQ端口冲突,负载均衡,主备配置
2011-07-17 16:03 5487在Java 学习中Window操作系 ... -
ActiveMQ中消息权限策略
2011-07-17 00:31 2620在ActiveMQ发送消息的时候,可以通过MessageAut ... -
ActiveMQ和Jetty整合使用
2011-07-07 22:49 5515在ActiveMQ中的activemq.b ... -
ActiveMQ 和Commons-Daemon整合
2011-07-07 20:13 2900在一般的java项目中,如果在linu ... -
关于ActiveMQ中怎么实现一对多发送消息讨论
2011-07-07 19:50 6020无 ... -
ActiveMQ 中ActiveMQBlobMessage的接收和发送
2011-07-05 10:47 5086在ActiveMQ中对比较大的消息采用一 ... -
ActiveMQ 和JAXWS整合
2011-07-04 22:02 2176在多个系统中可能考虑到远程访问等的,采用WebServ ... -
ActiveMQ-Camel的使用
2011-07-02 10:27 10159在一个电子系统中可能接受来自不同供应商的 ... -
ActiveMQ模板和Velocity整合使用
2011-07-01 19:50 2266ActiveMQ模板使用 在ActiveMQ中AMQ ... -
ActiveMQ中消息游标
2011-06-30 18:16 2623在 ActiveMQ 5.0的之前版本中,b ... -
ActiveMQ和Tomcat的整合应用
2011-06-30 17:00 11154在ActiveMQ的资源让容器Tomcat管理时 ... -
ActiveMQ关于文件传输需要注意哪些方面?
2011-06-18 22:11 6132最近一直在关注一些文件传输中间件的实现,想用Acti ... -
关于ActiveMQ中Session和Connection资源的管理
2011-06-15 23:43 25046配置完了持久化之后,我们就可以使用代码来发送 ... -
ActiveMQ中关于文件锁的机制的学习
2011-06-14 23:31 3243在ActiveMQ中提供了文件数据库机 ...
相关推荐
自己实现的ActiveMQ连接池和新版本ActiveMQ自带的连接池,封装好的工具类,可直接使用
自己实现的ActiveMQ连接池和新版本ActiveMQ自带的连接池,封装好的工具类,可直接使用,自己在网上找的时候好多都是纯Demo性质的,没有好的思想可以学习,希望我的劳动成果可以供你学习借鉴
主要介绍了Spring Boot ActiveMQ连接池配置过程解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
ActiveMQ如何整合Spring并使用连接池的方式,还有一些必须基础jar包
下载后可直接导入Maven项目运行,包含ActiveMQ的连接代码以及数据插入和读取测试
ActiveMQ相关jar包--使用Connection连接池,jar的版本很重要,请注意。
activemq消息测试工具
MQ的消费-生产者模型的一个典型的代表,一端往消息队列中不断的写入消息,而另一端则可以读取或者订阅队列中的消息。MQ和JMS类似,但不同的是JMS是SUN JAVA消息中间件服务的一个标准和API定义,而MQ则是遵循了AMQP...
JMS即Java消息服务(Java Message Service)应用程序接口,是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间,或分布式系统中发送消息,进行异步通信。...而ActiveMQ就是对JMS的实现之一。
使用activemq依赖库连接, 该项目为java工程,内有ssl证书生成方式链接,不清楚可私信
ActiveMQ高并发处理方案
用于ACtiveMq 配置插件配置使用,配置介绍等,适合初学者
ActiveMQ_使用failover模式进行连接切换时,线程断开 ,ActiveMQ_使用failover模式进行连接切换时,线程断开
activemq activeMq笔记.docx
发布/订阅消息传递域的特点如下:(1)生产者将消息发布到topic中,每个消息可以有多个消费者,属于1:N关系(2)生产者和...启动ActiveMQ之后访问http://localhost:8161/admin/topics.jsp,此时的Topic中什么也没有先
最新activemq-cpp开发手册!
apache-activemq Linux版本
针对官网下载比较慢的情况,提供本地的压缩包供大家使用,与官网内容同步。- _ -
spring boot activemq集成示例,包含queue和topic消息的发送、接收,连接池的支持。
activemq书籍及工具 activemq书籍及工具 activemq书籍及工具 activemq书籍及工具 activemq书籍及工具