Am novice when it comes to Spring integration and so had some questions around it. Am trying to integrate Spring Integration with the MQ Series and believe that all my IBM MQ(Q Connection Factory and Queue) entries should be going inside my applicationcontext.xml file. I have the applicationcontext file for ActiveMQ Implementation and just wanted to know what exactly an IBM MQ specific entries in App Contest file will look like. Questions are -
Thanks in advance.
You can create beans like this
jms.transportType=1 jms.queueManager=YOUR_QUEUE_MANAGER jms.hostName=YOUR_HOSTNAME jms.port=1321 jms.channel=YOUR_CHANNEL jms.receiver.queue.name=YOUR_QUEUE jms.username= jms.alias= jms.mq.connection.factory=jmsConnectionFactory jms.mq.receiver.queue=receiverQueue
<bean id="jmsConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType" value="${jms.transportType}"/>
<property name="queueManager" value="${jms.queueManager}"/>
<property name="hostName" value="${jms.hostName}"/>
<property name="port" value="${jms.port}" />
<property name="channel" value="${jms.channel}"/>
</bean>
<bean id="secureJmsConnectionAdapter" class="yourpackages.SecureJMSConnectionAdapter">
<property name="targetConnectionFactory" ref="${jms.mq.connection.factory}" />
<property name="userName" value="${jms.username}"/>
<property name="pwdAlias" value="${jms.alias}"/>
</bean>
<bean id="receiverQueue" class="com.ibm.mq.jms.MQQueue">
<constructor-arg index="0" value="${jms.queueManager}"/>
<constructor-arg index="1" value="${jms.receiver.queue.name}"/>
</bean>
<bean id="receiverJMSTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="secureJmsConnectionAdapter" />
<property name="pubSubDomain" value="false"/>
<property name="defaultDestination" ref="${jms.mq.receiver.queue}"/>
<property name="receiveTimeout" value="30000"/>
</bean>
<bean class="org.springframework.jms.listener.SimpleMessageListenerContainer">
<property name="connectionFactory" ref="secureJmsConnectionAdapter" />
<property name="destinationName" value="${jms.receiver.queue.name}" />
<property name="messageListener" ref="mQListener" />
</bean>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With