I'm working on sending and receiving messages to/from an IBM MQ queue using JmsTemplate. My application is installed on a WebSphere application server 8.0 and, in order to retrieve the connection, I use a jndi lookup.
I have 6 queues from where I need to pick/drop xmls depending on scenarios. Also I have added these queue in WAS. I need help to understand two things:
I should use
DynamicDestinationResolver
orJndiDestinationResolver
?As per my understanding I should use
JndiDestinationResolver
; if that is right how I can define that in my context file and referjndi-lookup
for each queue so that I can retrieve it from my code while using jmsTemplate send/receive?
Please see below my application context file:
<bean id="jmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jms/CPC.TapQueueConnCPC" />
<property name="lookupOnStartup" value="false" />
<property name="cache" value="true" />
<property name="proxyInterface" value="javax.jms.QueueConnectionFactory" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
<property name="receiveTimeout" value="10000" />
<property name="sessionAcknowledgeMode" value="1" />
<property name="destinationResolver" ref="jmsDestResolver"/>
</bean>
<bean id="fileTransferServiceImpl" class="org.kp.cpc.service.FileTransferServiceImpl" >
<constructor-arg name="jmsTemplate" ref="jmsTemplate" />
</bean>
<bean id="jmsDestResolver" class=" org.springframework.jms.support.destination.JndiDestinationResolver"/>
<jee:jndi-lookup id="drop278" jndi-name="jms/CPC.SEND.AUTHREQ278" />
<jee:jndi-lookup id="drop275" jndi-name="jms/CPC.SEND.AUTHREQ275" />
<jee:jndi-lookup id="recev278" jndi-name="jms/CPC.RECE.AUTHREQ278" />
<jee:jndi-lookup id="recev275" jndi-name="jms/CPC.RECE.AUTHREQ275" />
<jee:jndi-lookup id="preAuthStatus" jndi-name="jms/CPC.RECE.PREAUTH.STSUPD278"/>
<jee:jndi-lookup id="succ278" jndi-name="jms/CPC.RECE.SUCC.AUTHRESP278" />