camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel 2.0 Transaction Rollback
Date Fri, 24 Jul 2009 07:06:04 GMT
You route is using doTry and doCatch

        <camel:route errorHandlerRef="transactionErrorHandler">
            <camel:from

uri="routingExampleSingleResponseActivemqComponent:queue:routingExampleWebService?concurrentConsumers=1"
/>
            <camel:policy ref="PROPAGATION_REQUIRED_POLICY" />
            <camel:doTry>
                <camel:to
uri="bean:routingExamplesWebServiceCaller?method=execute" />
                <camel:doCatch>
                    <camel:exception>java.lang.Exception</camel:exception>
                    <camel:process
ref="routingExampleExceptionRecordingProcessor" />
                </camel:doCatch>
            </camel:doTry>
            <camel:to
uri="bean:routingExamplesPooledWebServiceExecutorBean?method=execute"
/>
        </camel:route>


And when you use doCatch its like the try .. catch in regular Java
where you handle the exception.

Try using the tracer to see how you message is being routed by Camel
http://camel.apache.org/tracer.html

And also check the TRACE log of:
org.apache.camel.spring.spi.TransactionErrorHandlerBuilder as its the
one the configures the TX error handler and it would be nice to know
if it does it correct.

And there is also a new DSL for setting the TX in a route:
    <camel:transacted ref="PROPAGATION_REQUIRED_POLICY" />
instead of using
    <camel:policy ... >


On Tue, Jul 21, 2009 at 6:27 PM, greenbean<Kevin.Urciolo@ngc.com> wrote:
>
> Attached are two files.  One is the spring xml containing the route.  The
> other is the log file.
>
> The route I am currently testing is the one that consumes from the
> routingExampleSingleResponse queue.  It is near the top.
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> You route is not listed in the mail. Could you try sending it again?
>>
>>
>> On Fri, Jul 17, 2009 at 9:53 PM, greenbean<Kevin.Urciolo@ngc.com> wrote:
>>>
>>> Here is the sample route:
>>>
>>>
>>>
>>>
>>>
>>>
>>>                    java.lang.Exception
>>>
>>>
>>>
>>>
>>>
>>>
>>> Here is some of the debug logging:
>>> 2009-07-17 19:47:07,045 DEBUG
>>> [org.apache.camel.spring.spi.TransactionErrorHandler]
>>> (routingExampleSingleResponseThreadPoolExecutor-1) Failed delivery for
>>> exchangeId: ID:csnwas16-38154-1247835958285-3:112:1:1:1. On delivery
>>> attempt: 0 caught: java.lang.Exception: Simulated error created...
>>> 2009-07-17 19:47:07,046 DEBUG
>>> [org.apache.camel.spring.spi.TransactionErrorHandler]
>>> (routingExampleSingleResponseThreadPoolExecutor-1) This exchange is not
>>>  handled so its marked as failed: Exchange[JmsMessage:
>>> ActiveMQTextMessage
>>> {commandId = 5, responseRequired = false, messageId =
>>> ID:csnwas16-38154-12478359
>>> 58285-3:112:1:1:1, originalDestination = null, originalTransactionId =
>>> null,
>>> producerId = ID:csnwas16-38154-1247835958285-3:112:1:1, destination =
>>> queue://
>>> routingExampleSingleResponseIn, transactionId = null, expiration = 0,
>>> timestamp = 1247860020984, arrival = 0, brokerInTime = 1247860020988,
>>> brokerOutTime =
>>>  1247860020991, correlationId = null, replyTo = null, persistent = false,
>>> type = null, priority = 0, groupID = null, groupSequence = 0,
>>> targetConsumerId =
>>> null, compressed = false, userID = null, content = null,
>>> marshalledProperties = null, dataStructure = null, redeliveryCounter = 4,
>>> size = 0, properties = n
>>> ull, readOnlyProperties = true, readOnlyBody = true, droppable = false,
>>> text
>>> = error}]
>>> 2009-07-17 19:47:07,046 DEBUG
>>> [org.apache.camel.spring.spi.TransactionErrorHandler]
>>> (routingExampleSingleResponseThreadPoolExecutor-1) Setting transaction
>>> to rollbackOnly due to exception being thrown: java.lang.Exception:
>>> Simulated error created...
>>>
>>> This is the last line of logging before the message disappears:
>>> 2009-07-17 19:47:07,048 WARN
>>> [org.springframework.jms.listener.DefaultMessageListenerContainer]
>>> (routingExampleSingleResponseThreadPoolExecutor-1) Execution of JMS
>>> message
>>> listener failed
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> On Fri, Jul 17, 2009 at 3:34 PM, greenbean wrote:
>>>>>
>>>>> We are using Camel 2.0 with ActiveMQ 5.  Our Camel routes participate
>>>>> in
>>>>> a XA
>>>>> transaction.  When errors occur we expect the transaction to rollback
>>>>> to
>>>>> a
>>>>> JMS queue.  We have ActiveMQ configured to send the message to a DLQ
>>>>> where
>>>>> it then travels down a error route.
>>>>>
>>>>> This worked in the past.  However, recently I found that the messages
>>>>> no
>>>>> longer make it to the DLQ.  I have been updating my Camel 2.0 source
>>>>> from
>>>>> SVN every so often and rebuilding.  I am wondering if something changed
>>>>> that
>>>>> I need to take in to account.
>>>>>
>>>>> Currently it seems the transaction does a rollback and redelivery five
>>>>> times.  Then the message disappears.  It does not go to a DLQ, nor
does
>>>>> it
>>>>> go back to the original queue.  Do I need to change a configuration
to
>>>>> support the newer 2.0 build of Camel that I am now using?
>>>>>
>>>>
>>>> Can you paste your route.
>>>> And run with DEBUG/TRACE logging for org.apache.camel.spring as the
>>>> Camel transacted error handler lives there.
>>>> It should indicate when its rolling back etc.
>>>>
>>>>
>>>>
>>>>
>>>>> Thanks.
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Camel-2.0-Transaction-Rollback-tp24534561p24534561.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>> Here is some of the debug logging:Here is some of the debug logging:
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Camel-2.0-Transaction-Rollback-tp24534561p24540640.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
> http://www.nabble.com/file/p24591032/server.log.2009-07-17
> server.log.2009-07-17
> http://www.nabble.com/file/p24591032/central-routingexamplebeans.xml
> central-routingexamplebeans.xml
> --
> View this message in context: http://www.nabble.com/Camel-2.0-Transaction-Rollback-tp24534561p24591032.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message