0 Replies Latest reply on Jun 27, 2017 12:16 PM by sabarinathm

    Transaction is not getting committed, even exception is handled in <do-catch>




      We have switchyard components, which are Consumer(Receives message from Queue), Router(Transformation & Routing logic) & Provider (Will Endpoint provider). This is developed using Jboss EAP 6.1. As mentioned earlier, flow of our integration is request will be placed in Queue, consumer reads the message and router do the transformation, if any and the provider will call the endpoint or place the message in queue.


      Here we have implemented transaction using JtaTransactionManager. Address settings configuration for queue is done in standalone.xml. So if there is any issue in getting connected to target system,  all the operations will rolled back and the messasge will be placed in Request Queue for retrying. Transaction is implemented successfully, and the components are able to retry, if the message is again placed in Queue.


      The problem here is, we don't want to retry for all the scenarios. We just want to enable retry, only for some cases like,

      • Connection timed out
      • Not able to connect to EndPoint.


      It is retrying for the scenario, even if there is no router component available.


      Flow will be like - Consumer -> Router -> Provider

      Whenever the Router component is not available, Switchyard will throw null pointer exception, and I don't want to transaction to be rolled back, instead I want message to be placed in response queue, with the error response. But once the exception is thrown, it reaches catch block, and it is executing all the commands in catch block. Even though it is handled in <doCatch>, it is not getting handled. It is rolling back the transaction and am getting the error message saying "could not commit the transaction".  In otherwords, Response message (Error Message) is placed in queue and it is getting rolled back, since the transaction is not committed.




      15:28:03,248 INFO  [org.apache.camel.spring.spi.TransactionErrorHandler] (pool-132-thread-2) Transaction commit (0x6747156f) redelivered(true) for (MessageId: queue_QueueName_cf9e2193-5b44-11e7-bea3-8b52281b9651 on ExchangeId: ID-VG02LT3179-55618-1498473992628-51-8))

      15:28:03,253 WARN  [org.hornetq.core.server] (Thread-22 (HornetQ-server-HornetQServerImpl::serverUUID=beaaa07b-d71f-11e6-99ee-2beda2399e7a-1692093144)) HQ222148: Message Reference[81618460562]:RELIABLE:ServerMessage[messageID=81618460562,priority=4, bodySize=1674,expiration=0, durable=true, address=jms.queue.QueueName,properties=TypedProperties[{__HQ_CID=cf82f870-5b44-11e7-bea3-8b52281b9651}]]@1662350942 has exceeded max delivery attempts. No bindings for Dead Letter Address jms.queue.DLQ so dropping it

      15:28:03,254 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (pool-132-thread-2) Setup of JMS message listener invoker failed for destination 'QueueName' - trying to recover. Cause: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.

      15:28:03,256 INFO  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (pool-132-thread-2) Successfully refreshed JMS Connection



      Any help would be much appreciated! Thank in Advance!