You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by niels_s <st...@gmail.com> on 2013/09/26 14:02:30 UTC

Is it possible to retrieve a stream for a Exchange Body?

Hey there,

I'm experimenting and creating my own component to use Apache Tika.
Now I was wondering if it's possible to retrieve a stream for a Exchange
Body?

I'm trying like this right now but doesn't seem to do the job:

InputStream is = exchange.getIn().getBody(java.io.InputStream.class);

I'm using Camel's DefaultComponent and DefaultProducer. Maybe I should be
using the StreamProducer?
Can anybody get me on the right direction?

Thanks ,

Niels




--
View this message in context: http://camel.465427.n5.nabble.com/Is-it-possible-to-retrieve-a-stream-for-a-Exchange-Body-tp5740229.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is it possible to retrieve a stream for a Exchange Body?

Posted by Christian Mueller <ch...@gmail.com>.
Niels_s, 

can you please subscribe to the discussion forum in Nabble as we describe
here [1].
Otherwise all your mails has to be moderate manually by the Camel team so
that your post is also send to our mailing list which most of the Camel team
member are using instead of Nabble. Therefore your post is may
missed/delayed and you don't get an answer in the normal time frame we
answer questions.
Last but not least, it cost time which we cannot spend developing Camel,
answering questions or improving the documentation...

[1] http://camel.apache.org/discussion-forums.html

Thanks in advance,
Christian



--
View this message in context: http://camel.465427.n5.nabble.com/Is-it-possible-to-retrieve-a-stream-for-a-Exchange-Body-tp5740229p5741659.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is it possible to retrieve a stream for a Exchange Body?

Posted by niels_s <st...@gmail.com>.
Hey Christian,

I found a solution using a 'convertBodyTo' with InputStream as type I got it
working.

Thanks for the help





--
View this message in context: http://camel.465427.n5.nabble.com/Is-it-possible-to-retrieve-a-stream-for-a-Exchange-Body-tp5740229p5741653.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is it possible to retrieve a stream for a Exchange Body?

Posted by Christian Posta <ch...@gmail.com>.
Well, what exception are you getting? Or is it not throwing an exception?
Camel uses type converters [1] to do that kind of conversion. Depending on
the body type currently, you may have to write your own converter.

[1]... http://camel.apache.org/type-converter.html


On Thu, Sep 26, 2013 at 5:02 AM, niels_s <st...@gmail.com> wrote:

> Hey there,
>
> I'm experimenting and creating my own component to use Apache Tika.
> Now I was wondering if it's possible to retrieve a stream for a Exchange
> Body?
>
> I'm trying like this right now but doesn't seem to do the job:
>
> InputStream is = exchange.getIn().getBody(java.io.InputStream.class);
>
> I'm using Camel's DefaultComponent and DefaultProducer. Maybe I should be
> using the StreamProducer?
> Can anybody get me on the right direction?
>
> Thanks ,
>
> Niels
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Is-it-possible-to-retrieve-a-stream-for-a-Exchange-Body-tp5740229.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta