You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kannan <ra...@gmail.com> on 2010/11/16 15:10:13 UTC

ConvertBodyTo is problem when transaction failed

Hi 

   I am convert the message body to given class type and save the object
into DB.if transaction failed the message will send to dead letter queue.
Now deadLetter queue will contain converted type message or original message
?

-- 
View this message in context: http://camel.465427.n5.nabble.com/ConvertBodyTo-is-problem-when-transaction-failed-tp3267361p3267361.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ConvertBodyTo is problem when transaction failed

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Nov 17, 2010 at 3:48 AM, Willem Jiang <wi...@gmail.com> wrote:
> On 11/17/10 12:29 AM, Claus Ibsen wrote:
>>
>> On Tue, Nov 16, 2010 at 3:10 PM, Kannan<ra...@gmail.com>  wrote:
>>>
>>> Hi
>>>
>>>   I am convert the message body to given class type and save the object
>>> into DB.if transaction failed the message will send to dead letter queue.
>>> Now deadLetter queue will contain converted type message or original
>>> message
>>> ?
>>
>> By default the message contains whatever it was before the "step" in
>> the Camel route failed.
>>
>> However you can use the .useOriginalMessage() option on the Dead
>> Letter Channel to tell it to use the original input message instead.
>
> What if there is an InputStream in the OriginalMessage?
> I don't think we can read it twice if camel don't cache it.
>>

Then you need to enable stream caching.

>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/ConvertBodyTo-is-problem-when-transaction-failed-tp3267361p3267361.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: ConvertBodyTo is problem when transaction failed

Posted by Willem Jiang <wi...@gmail.com>.
On 11/17/10 12:29 AM, Claus Ibsen wrote:
> On Tue, Nov 16, 2010 at 3:10 PM, Kannan<ra...@gmail.com>  wrote:
>>
>> Hi
>>
>>    I am convert the message body to given class type and save the object
>> into DB.if transaction failed the message will send to dead letter queue.
>> Now deadLetter queue will contain converted type message or original message
>> ?
>
> By default the message contains whatever it was before the "step" in
> the Camel route failed.
>
> However you can use the .useOriginalMessage() option on the Dead
> Letter Channel to tell it to use the original input message instead.

What if there is an InputStream in the OriginalMessage?
I don't think we can read it twice if camel don't cache it.
>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/ConvertBodyTo-is-problem-when-transaction-failed-tp3267361p3267361.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: ConvertBodyTo is problem when transaction failed

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 16, 2010 at 3:10 PM, Kannan <ra...@gmail.com> wrote:
>
> Hi
>
>   I am convert the message body to given class type and save the object
> into DB.if transaction failed the message will send to dead letter queue.
> Now deadLetter queue will contain converted type message or original message
> ?

By default the message contains whatever it was before the "step" in
the Camel route failed.

However you can use the .useOriginalMessage() option on the Dead
Letter Channel to tell it to use the original input message instead.

>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ConvertBodyTo-is-problem-when-transaction-failed-tp3267361p3267361.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/