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: Original message body lost in transacted route
Date Mon, 23 Nov 2009 18:27:09 GMT
On Mon, Nov 23, 2009 at 6:31 PM, Dragisa Krsmanovic
<dkrsmanovic@plos.org> wrote:
> On Sat, 2009-11-21 at 09:20 +0100, Claus Ibsen wrote:
>> Hi
>>
>> Digged a bit deeper and seems the issue is that the assertion on the
>> constant seems wrong as you set the body to an empty string.
>> Which then causes Camel to look into the backing JMS message where it
>> can find the "foo" body. Despite the body is "".
>>
>> Seems as Camel in the setBody should also set a DefaultMessage to
>> prevent still propagating specialized messages contains when you have
>> changed the body to something else.
>> Using this the backing JMS message will be gone and the "foo" message
>> is not present anymore.
>>
>> The problem is that you want to use transacted routes and using Camel
>> redelivery policies, eg the stuff you do with onException.
>> What happens at runtime is that the message is NOT rolled back to the
>> JMS queue as Camel does local error handling. So after 2 errors its
>> just handled=true and moved to a mock.
>>
>> And  .useOriginalBody() is only triggered when the message is moved to
>> the mock:error queue.
>>
>>
>
> Thanks! This clears up many things. Perhaps documentation should be more
> detailed on transacted vs. non-transacted error handling.
>

There is already a lot of error handling documentation at the wiki.
And contributions is welcome.
See more at
http://camel.apache.org/contributing.html

I have enough write responsibility at the moment with the book. So I
dont have time to work on wiki docs.
As a matter of fact I am currently writing on chapter 9 which is about
using transactions with Camel.
So in the book you will have 30+ pages of documentation.



> Another question. I want to redeliver N times and, if all fail, send
> message to another queue. If I want messages to be rolled back to JMS
> each time (not redelivered to the failed part of the route). How would I
> do that ?
>
>

If I understand you questions correct then configure the JMS broker
to redeliver N times and move the message to X DLQ.

If using AMQ then check its documentation how to do this.



> --
> Dragisa Krsmanovic
> Java Developer
> Public Library of Science
> http://www.plos.org
>
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> This email is confidential to the intended recipient. If you have received it in error,
please notify the sender and delete it from your system. Any unauthorized use, disclosure
or copying is not permitted. The views or opinions presented are solely those of the sender
and do not necessarily represent those of Public Library of Science unless otherwise specifically
stated. Please note that neither Public Library of Science nor any of its agents accept any
responsibility for any viruses that may be contained in this e-mail or its attachments and
it is your responsibility to scan the e-mail and attachments (if any).
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message