Results 1 to 2 of 2

Thread: session auto ack setting

  1. #1
    Join Date
    Jul 2009
    Posts
    12

    Default session auto ack setting

    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>

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,630

    Default

    Simply set it. The property is called 'sessionAcknowledgeMode'...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •