IBM MQ + WebSphere + Spring JMS配置方法 

首先要在WAS里面配置IBM MQ作为JMS消息的提供者,在WAS管理控制台: Resources->JMS Providers->WebSphere MQ,首先创建一个连接工厂,点击 WebSphere MQ connection factories 填好配置选项,CCSID 注意下这个选项,这个是队列管理器所用到的字符集,中文简体(1381),其他的就没什么要特别注意的地方了,保存后返回到前一页面。点击WebSphere MQ queue destinations 进入后点击NEW进入创建页面,注意 Base queue name 这一选项要填写跟MQ一样的消息队列名称。Target client 有JMS和MQ两个区别,如果你想在队列里面存放java序列化对象就得选JMS,其他选项任意填然后保存。

下面是Spring配置代码:

Java代码  
        1.<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd ">
2.<jee:jndi-lookup id="connectionFactory" jndi-name="${jms.connection.factory}">
3. <jee:environment>
4. java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory java.naming.provider.url=iiop://localhost:2809
5. java.naming.factory.url.pkgs=com.ibm.ws.naming
6. </jee:environment>
7.</jee:jndi-lookup>
8.<jee:jndi-lookup id="destination" jndi-name="${jms.connection.destination}">
9. <jee:environment>
10. java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory java.naming.provider.url=${jms.provider.url} java.naming.factory.url.pkgs=com.ibm.ws.naming
11. </jee:environment>
12.</jee:jndi-lookup>
13.<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
14. <property name="connectionFactory" ref="connectionFactory" />
15. <property name="defaultDestination" ref="destination" />
16.</bean>
17.<bean id="messageProducer" class="govhk.ha.eface.core.jms.MessageProducer">
18. <property name="jmsTemplate" ref="jmsTemplate" />
19.</bean>
20.<bean id="messageListener" class="govhk.ha.eface.core.jms.MessageConsumer"> </bean>
21.<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
22. <property name="connectionFactory" ref="connectionFactory" />
23.</bean>
24.<bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
25. <property name="concurrentConsumers" value="5" />
26. <property name="connectionFactory" ref="connectionFactory" />
27. <property name="destination" ref="destination" />
28. <property name="messageListener" ref="messageListener" />
29. <property name="transactionManager" ref="jmsTransactionManager" />
30.</bean>
31.<bean id="mailSender" class="govhk.ha.eface.core.mail.MailSender">
32. <property name="messageProducer" ref="messageProducer" />
33.</bean>

IBM MQ + WebSphere + Spring JMS配置方法的更多相关文章

  1. IBM MQ 与spring的整合

    文件名:applicationContext-biz-mq.xml 新浪博客把里面的代码全部转换成HTML了,所以无法粘贴 可以查看CSDN里面的:http://blog.csdn.net/xiazo ...

  2. VS2015ASP.NET MVC5项目中Spring.NET配置方法(超详细)

    首先,在ASP.NET MVC5项目右键,如下图所示,选择“管理Nuget程序包...” 然后,在弹出的页面的搜索框中输入“spring.web”,在返回结果中选择Spring.Web和Spring. ...

  3. 使用Spring JMS轻松实现异步消息传递

    异步进程通信是面向服务架构(SOA)一个重要的组成部分,因为企业里很多系统通信,特别是与外部组织间的通信,实质上都是异步的.Java消息服务(JMS)是用于编写使用异步消息传递的JEE应用程序的API ...

  4. IBM Mq Spring JMS 的xml配置

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  5. spring监听与IBM MQ JMS整合

    spring xml 的配置: 文件名:applicationContext-biz-mq.xml <?xml version="1.0" encoding="UT ...

  6. IBM WebSphere MQ介绍安装以及配置服务详解

    首先介绍一下MQ MQ消息队列的简称是一种应用程序对应用程序的通信方法.说白了也就是通过队列的方式来对应用程序进行数据通信.而无需专用链接来链接它们. MQ的通讯方式 1.数据报的方式 Datagra ...

  7. IBM WebSphere MQ介绍安装以及配置服务详解(转)

    首先介绍一下MQ MQ消息队列的简称是一种应用程序对应用程序的通信方法.说白了也就是通过队列的方式来对应用程序进行数据通信.而无需专用链接来链接它们. MQ的通讯方式 1.数据报的方式 Datagra ...

  8. IBM MQ 集成CXF 发送JMS 消息

    0.POM依赖 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w ...

  9. spring中配置监听队列的MQ

    一.spring中配置监听队列的MQ相关信息注:${}是读取propertites文件的常量,这里忽略.绿色部分配置在接收和发送端都要配置.  <bean id="axx" ...

随机推荐

  1. 第15章 高并发服务器编程(1)_非阻塞I/O模型

    1. 高性能I/O (1)通常,recv函数没有数据可用时会阻塞等待.同样,当socket发送缓冲区没有足够多空间来发送消息时,函数send会阻塞. (2)当socket在非阻塞模式下,这些函数不会阻 ...

  2. ElasticSearch client API

    从运行结果看并没有打印节点信息出来 从结果看出来,集群节点信道打印出来了,不过这种方法有个问题,就是当我们连接的节点挂掉了,就没法连接整个集群了,这个时候我们就利用他的一个嗅探的功能. 从这里我们可以 ...

  3. InterlliJ IDEA 2017.3.x / 2017.3.4 License Server激活

    InterlliJ IDEA 2017.3.x / 2017.3.4 License Server激活 1.Lincense Server激活 // 激活IDEA的License Server 地址 ...

  4. selenium+python自动化98--文件下载弹窗处理(PyKeyboard)

    前言 在web自动化下载操作时,有时候会弹出下载框,这种下载框不属于web的页面,是没办法去定位的(有些同学一说到点击,脑袋里面就是定位!定位!定位!) 有时候我们并不是非要去定位到这个按钮再去点击, ...

  5. django-插件django REST framework,返回序列化的数据

    官网: http://www.django-rest-framework.org 1.安装 pip install djangorestframework 2.在setting.py中注册app 中添 ...

  6. FMX ScrollBox 拖拽控制

    Firemonkey下的ScrollBox 拖拽控制,滚动控制,拖拽,滚动条 AniCalculations 仅允许纵向拖拽,拖拽 scrlbx.AniCalculations.TouchTracki ...

  7. 迭代器iter()

    from collections import Iterable print(isinstance({},iterable)) # 判断是否可迭代 from collections import It ...

  8. AS3 注意点

    当主类new 一个主影片来放内容的时候.在gc此swf时,一定要检查此主影片是否存在,如 private function initStart() { //trace("RightMenu类 ...

  9. Simple2D-21(重构)渲染部分

    以前 Simple2D 的渲染方法是先设置 Pass,然后添加顶点数据,相同 Pass 的顶点数据会合并在一起.当设置新的 Pass 时,将旧的 Pass 和对应的顶点数据添加到渲染数组中.最后在帧结 ...

  10. 10 python 封装----@property的用法

    1.基本概念 在python中用双下划线开头的方式将属性隐藏起来(设置成私有的) #其实这仅仅这是一种变形操作 #类中所有双下划线开头的名称如__x都会自动变形成:_类名__x的形式: class A ...