转自:http://blog.sincerad.com/archives/%E5%9C%A8java%E4%B8%AD%E4%BD%BF%E7%94%A8spring-jms%E9%9B%86%E6%88%90websphere-mq%EF%BC%8Ctopic%E5%8F%91%E5%B8%83%E5%92%8C%E8%AE%A2%E9%98%85
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd"> <!-- MQ链接工厂对象 -->
<bean id="topicConnectionFactory" class="com.ibm.mq.jms.MQTopicConnectionFactory">
<!-- MQ服务器地址 -->
<property name="hostName" value="127.0.0.1" />
<!-- 端口 -->
<property name="port" value="1414" />
<!-- MQ消息队列管理器 -->
<property name="queueManager" value="QM1" />
<!-- MQ通道 -->
<property name="channel" value="SYSTEM.DEF.SVRCONN" />
<!-- 链接方式 -->
<property name="transportType" value="1" />
<!-- TCP --> </bean>
<!-- MQ Topic模板 -->
<!-- 发布消息 jmsTopicTemplate.convertAndSend("topic://test", "Hello world!"); -->
<bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate"> <constructor-arg ref="topicConnectionFactory" />
<!-- Topic 需要加入 -->
<property name="pubSubDomain" value="true" />
</bean>
<!-- 消息监听器1 -->
<bean id="messageListener" class="com.ii2d.mq.MessageListenerForTest" />
<!-- 消息监听器2 --> <bean id="messageListener2" class="com.ii2d.mq.MessageListenerForTest" />
<!-- 把监听器加入到Spring消息监听管理容器 -->
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="topicConnectionFactory" />
<property name="destinationName" value="topic://test" /> <property name="messageListener" ref="messageListener" /> <property name="pubSubDomain" value="true" /> </bean>
<!-- 把监听器加入到Spring消息监听管理容器 -->
<bean id="jmsContainer2" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="topicConnectionFactory" />
<property name="destinationName" value="topic://test" /> <property name="messageListener" ref="messageListener2" /> <property name="pubSubDomain" value="true" />
</bean>
</beans>
分享到:
相关推荐
用jms 向webshpere mq里发送消息
本电子书详细介绍了jms ,mq 的java编程,希望对有需要的朋友有所帮助。
本人自学IBM的WebSphereMQ自学笔记,内有MQ安装文档,建MQ的例子等。 1、 MQ6.0安装 2 1.1 启动MQ v6.0 安装程序 2 1.2 软件需求检查 2 1.3 WebSphere Eclipse Platform V3.0.1软件安装 2 1.4 网络配置检查 3 1.5 ...
Java下操作IBM Websphere MQ的项目案例, eclipse工程压缩包, 导入直接可用.
NULL 博文链接:https://j2ee2009.iteye.com/blog/689165
12.3 使用WebSphere MQ for Java 161 12.3.1客户机连接模式 161 12.3.2绑定模式 162 12.3.3 类库 162 12.4用WebSphere MQ Java API开展工作 164 12.4.1 设置连接 164 12.4.2 打开队列 165 12.4.3 处理WebSphere MQ...
Websphere MQ JavaJMS 客户端的 SSL 配置.doc
Java 通过PCF连接WebSphere MQ7.1以上版本获取数据。!!!
IBM WebSphere MQ是IBM业界领先面向消息的中间件产品,也是MQ系列产品的基础和核心,它使不同的应用程序能够以企业级的性能,在广泛的平台上安全而可靠地通讯。
WebSphere MQ7.0配置与测试 WebSphere MQ发送接收消息的实现 附java 源码
WebSphere MQ Using Java,MQ作为一种中间件还是不错的,可以由一个系统发送一些消息给MQ Server,然后另外一个系统来取得这些消息。比较方便的实现不同系统、不同语言间的通信。
全书共分为3部分共14章,第一部分 WebSphere MQ原理和体系结构,分为两章;第二部分 WebSphere MQ系统管理,分为六章,分别介绍安装、配置、管理、控制命令和问题确定;第三部分 WebSphere MQ应用开发,由五章组成,...
WebSphere® MQ (也称MQSeries)以一致的、可靠的和易于管理的方式来连接应用程序,并为跨部门、企业范围的集成提供了可靠的基础。通过为重要的消息和事务提供可靠的、一次且仅一次的传递,Websphere MQ 可以处理...
Websphere MQ Programming Guide,Websphere MQ Using C++,WebSphere MQ Using Java,WEBSPHERE MQ6.0 JAVA编程,WebSphere MQ基础教程,IBM WEBSPHERE MQ教程,精通WebSphere MQ,WebSphere MQ开发快速入门,IBM ...
Websphere MQ using java. Websphere MQ class for java and JMS.
Java连接IBM WebSphere MQ 7处理队列信息所需jar包,从安装目录直接打的包。主要包括: /com.ibm.mq.commonservices.jar /com.ibm.mq.defaultconfig.jar /com.ibm.mq.fta.jar /com.ibm.mq.headers.jar /...
Websphere MQ java编程发送和接收代码
IBM Websphere mq安装IBM Websphere mq安装
IBM websphereMQ 8.0....IBM\WebSphere MQ\java\lib下的文件 文件列表: com.ibm.mq.jms.Nojndi.jar com.ibm.mq.pcf.jar com.ibm.mq.allclient.jar com.ibm.mq.postcard.jar com.ibm.mq.axis2.jar com.ibm.mq.soap.jar ...
WebSphere MQ 开发培训 IBM软件部 软件部 WebSphere MQ 议程 WebSphere MQ 概览 WebSphere MQ 安装配置 WebSphere MQ 应用开发 WebSphere MQ 参考