camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Weird and unexpected behavior.
Date Wed, 04 Apr 2012 05:57:02 GMT
On Wed, Apr 4, 2012 at 3:55 AM, Raul Kripalani <> wrote:
> Sorry to say this behaviour is *not* weird at all ;)
> You are converting the Stream to a byte[] the first time around, but
> you are not storing the result on the Exchange.
> Therefore, the Exchange still contains a Stream, which happens to
> already be exhausted. Hence the byte[] size 0 after the second
> processor.
> Just set the IN message to the byte[] resulting from the conversion,
> by using Exchange.getIn().setBody(byte[]). And you should be good to
> go (unless I have failed to spot something else!).

Yes Raul is spot on.

> Regards,
> Raul.
> On 3 Apr 2012, at 22:31, "Knut-HÃ¥vard Aksnes" <> wrote:
>> Shouldn't .convertBodyTo(byte[].class) convert the stream content to a
>> re-readable byte array?
>> (I am the same person as Knut Aksnes-NOR, different accounts due to recent
>> changes in mail setup at job.)
>> Are there an easy way of tracing type conversions and/or list which type
>> converters are available, when debugging routes in camel? Both options would
>> ease debugging a lot. Such options might be there, but I am not aware of how
>> to use them. So I have had to fall back to processors and tracer. I have
>> been searching for such tools on the web pages and in Camel in Action.
>> --
>> View this message in context:
>> Sent from the Camel - Users mailing list archive at

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message