Hi,
I use Spring 3.1 and AMQ 5.4
I need to do trivial things and it does not work. Idea is to get a message,
put it to DB and commit into 2 systems. I use Weblogic JTA transaction
manager which works fine with Tibco EMS.
Listener's onMessage() throws RuntimeException which is caught and
suppressed by AbstractPollingMessageListenerContainer:
                                catch (Throwable ex) {
                                        if (status != null) {
                                                if (logger.isDebugEnabled()) {
                                                        logger.debug("Rolling 
back transaction because of listener exception
thrown: " + ex);
                                                }
                                                status.setRollbackOnly();
                                        }

Then transaction.commit happened with status above and I don't see message
removed from the Queue.This is what I need! But then no redelivery of
message happened and message marked as dequeued in AMQ UI.

AMQ settings are default whish suppose to use default RedeliveryPolicy.
Spring settings are:

  <bean id="jmsXAFactory"
     class="org.apache.activemq.ActiveMQXAConnectionFactory">
     <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
   </bean>


  <bean id="jmsXAConnectionFactory"
     class="org.jencks.pool.PooledSpringXAConnectionFactory">
     <property name="connectionFactory" ref="jmsXAFactory" />
     <property name="jtaTransactionManager" ref="transactionManager" />
   </bean>


 
        <bean id="inQueue" class="org.apache.activemq.command.ActiveMQQueue">
                <constructor-arg value="IN.QUEUE"/>
        </bean>
  <bean id="AmqMDPContainer"
    
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
     <property name="concurrentConsumers" value="1" /> 
     <property name="maxConcurrentConsumers" value="1" />
     <property name="maxMessagesPerTask" value="1" />
     <property name="connectionFactory" ref="jmsXAConnectionFactory" />
     <property name="destination" ref="inQueue" />
     <property name="messageListener" ref="receiverMDP" />
     <property name="transactionManager" ref="transactionManager" />
     <property name="messageSelector" value=""/>

     

   </bean>

        <bean id="receiverMDP" 
class="com.integration.incoming.ReceiverMDP"></bean>

Please help!

--
View this message in context: 
http://activemq.2283324.n4.nabble.com/XA-transaction-is-not-rolledback-in-DefaultMessageListenerContainer-tp3479072p3479072.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Reply via email to