• IBM MQ + WebSphere + Spring JMS配置方法


    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>  
  • 相关阅读:
    SQL Server中sys.syslogin中updatedate字段的浅析
    ORACLE 中NUMBER类型默认的精度和Scale问题
    SQL Server中sp_spaceused统计数据使用的空间总量不正确的原因
    Percona XtraBackup 安装介绍篇
    ORACLE中死锁的知识点总结
    Linux如何查看YUM的安装目录
    find: missing argument to `-exec'
    Linux平台下RMAN异机恢复总结
    WARNING: Re-reading the partition table failed with error 22: Invalid argument
    Windows Server 2012更新补丁后导致Micosoft ODBC for Oracle出现问题
  • 原文地址:https://www.cnblogs.com/yanduanduan/p/7156491.html
Copyright © 2020-2023  润新知