XML configuration for IBM Mq Spring JMS

Source: Internet
Author: User
Tags prefetch ibm mq

<?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:p= "http://www.springframework.org/schema/p"
Xmlns:jms= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/JMS"
Xsi:schemalocation= "Http://www.springframework.org/schema/beans
Http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
Http://www.springframework.org/schema/jms
Http://www.springframework.org/schema/jms/spring-jms-3.2.xsd ">

<!--WebSphere MQ Connection Factory--
<bean id= "Targetconnectionfactory" class= "Com.ibm.mq.jms.MQQueueConnectionFactory" >
<property name= "HostName" >
<value>${esbmon.mq.hostname}</value>
</property>
<property name= "Port" >
<value>${esbmon.mq.port}</value>
</property>
<property name= "QueueManager" >
<value>${esbmon.mq.queueManagerName}</value>
</property>
<property name= "Channel" >
<value>${esbmon.mq.channel}</value>
</property>
<!--com.ibm.mq.jms.jmsc.mqjms_tp_client_mq_tcpip=1--
<property name= "TransportType" value= "1"/>
</bean>

<!--spring is used to manage the connectionfactory of real connectionfactory;
Messagelistenercontainer has established a caching mechanism, where singleconnectionfactory is used directly instead of
Cachingconnectionfactory
-
<bean id= "ConnectionFactory" class= "Org.springframework.jms.connection.SingleConnectionFactory" >
<!--target ConnectionFactory corresponds to the real connectionfactory that can generate the JMS connection
<property name= "Targetconnectionfactory" ref= "Targetconnectionfactory"/>
<!--when using singleconnectionfactory, it's important to turn on reconnectonexception
<property name= "Reconnectonexception" value= "true" ></property>
</bean>

<!--JMS Destination Resolver--
<bean id= "Jmsdestinationresolver"
class= "Org.springframework.jms.support.destination.DynamicDestinationResolver" >
</bean>

<!--transaction Manager, MessageListener OnMessage method as a transaction--
<bean id= "Jmstransactionmanager"
class= "Org.springframework.jms.connection.JmsTransactionManager" >
<property name= "ConnectionFactory" ref= "ConnectionFactory"/>
</bean>

<!--configured as JTA things, is the message accepts the thing and the database operation thing to be able to rollback--
<bean id= "Jtatransactionmanager"
class= "Org.springframework.transaction.jta.JtaTransactionManager" >
<property name= "ConnectionFactory" ref= "ConnectionFactory"/>
<property name= "sessiontransacted" value= "true"/>
</bean>

<!--task processing thread pool--
<bean id= "Jmslistenertaskexecutor"
class= "Org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor" >
<property name= "Corepoolsize" >
<value>${esbmon.jmsListenerExecutor.corePoolSize}</value>
</property>
<property name= "Maxpoolsize" >
<value>${esbmon.jmsListenerExecutor.maxPoolSize}</value>
</property>
<property name= "Keepaliveseconds" >
<value>${esbmon.jmsListenerExecutor.keepAliveSeconds}</value>
</property>
<property name= "Queuecapacity" >
<value>${esbmon.jmsListenerExecutor.queueCapacity}</value>
</property>
<property name= "Rejectedexecutionhandler" >
<bean class= "${esbmon.jmslistenerexecutor.handler}"/>
</property>
<property name= "Threadnameprefix" value= "Jmslistenertaskexecutor"/>
</bean>

<!--JMS Listenercontainer is used to asynchronously accept messages, and the Jmstemplate class is used to produce messages and synchronously receive messages-
<!--Container-type: container type, default, simple, default102, or simple102---
<!--connection-factory:jms ConnectionFactory Bean References--
<!--task-executor:jms Taskexecutor Bean References--
<!--destination-resolver:destinationresolver Policy reference---
<!--a reference to the Message-converter:messageconverter policy
<!--destination-type: Destination type, queue, topic or durabletopic--
<!--Client-id: The ID of the container on the JMS client--
<!--confirmation mode for ACKNOWLEDGE:JMS messages, auto, client, Dups-ok, or transacted--
<!--Transaction-manager:platformtransactionmanager Bean references--
<!--concurrency: The maximum number of concurrent sessions that can be activated--
<!--prefetch: The maximum number of messages loaded into each session, increasing this value can cause concurrent idle--
<!--Receive-timeout: Timeout time per receive message--
<!--cache: Caching Levels--
<jms:listener-container container-type= "Default"
connection-factory= "Jtatransactionmanager" destination-type= "queue"
Transaction-manager= "Jmstransactionmanager" task-executor= "Jmslistenertaskexecutor"
Destination-resolver= "Jmsdestinationresolver" concurrency= "prefetch=" 100 "
receive-timeout= "acknowledge=" "transacted" >
<!--ID: Container Bean name--
<!--destination: The name of the destination, determined by the Destinationresolver policy
<!--ref: The bean name that handles the object--
<!--method: Called by the processor, if ref points to MessageListener or Sessionawaremessagelistener, this property can be ignored-
<!--selector: Optional message selector--
<jms:listener id= "Svcloglistener" destination= "${esbmon.mq.queuename.servicelog}"
ref= "Svclogjmslistener"/>
<jms:listener id= "Sysloglistener" destination= "${esbmon.mq.queuename.systemlog}"
ref= "Syslogjmslistener"/>
<jms:listener id= "Mqloglistener" destination= "${esbmon.mq.queuename.mqsvclog}"
ref= "Pubsublogjmslistener"/>
</jms:listener-container>

</beans>

XML configuration for IBM Mq Spring JMS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.