Hi all,
I am using DefaultMessageListenerContainer and MDPs to recieve messages from weblogic queue and need to insert that message in the database.
I am using org.springframework.transaction.jta.WebLogicJtaTra nsactionManager.
In the case of any exception, I do not see a rollback of the data inserted in the database instead I see that the message is put back on the queue. But I need both to happen.
I need the db rollback by setting JMS session AUTO ACK to false. How to set it through the spring config file?
Below is the current configuration in spring context file:
Code:<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref="jndiTemplate" /> <property name="jndiName" value="jms/xyzJMSConnectionFactory" /> </bean> <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref="jndiTemplate" /> <property name="jndiName" value="jms/xyzQueue" /> </bean> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.WebLogicJtaTransactionManager"/> <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" lazy-init="true"> <property name="concurrentConsumers" value="10" /> <property name="connectionFactory" ref="jmsConnectionFactory" /> <property name="destination" ref="destination" /> <property name="messageListener" ref="QListener" /> <property name="autoStartup" value="false" /> <property name="sessionTransacted" value="false" /> <property name="transactionManager" ref="jtaTransactionManager" /> </bean>


Reply With Quote