camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <>
Subject Re: Weird and unexpected behavior.
Date Wed, 04 Apr 2012 01:55:53 GMT
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

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!).


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

View raw message