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: Weird and unexpected behavior.
Date Wed, 04 Apr 2012 05:57:02 GMT
On Wed, Apr 4, 2012 at 3:55 AM, Raul Kripalani <raul@fusesource.com> 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" <khaksnes@gmail.com> 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: http://camel.465427.n5.nabble.com/Weird-and-unexpected-behavior-tp5615358p5616461.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message