You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dunnlow <du...@yahoo.com> on 2012/10/01 21:01:46 UTC

Message Headers to file component?

Hi, am trying to pass information between two camel apps via file.  I
envisioned a way to redirect a message (body and headers) to a file and then
have the second app consume that file as a message (just as if it had
originated on the second system).  

I tried just sending the original message to the file component, but only
the message gets output (no headers).  I figured the solution was to marshal
to/from xstream but this just puts the message in xml (no headers again):

  from ("direct:tofile").marshal().xstream().to("file:outbox");

What is the easiest/best way to marshal a message (body and headers, dont
need attachments) to a file?

Thanks,
-J



--
View this message in context: http://camel.465427.n5.nabble.com/Message-Headers-to-file-component-tp5720327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message Headers to file component?

Posted by dunnlow <du...@yahoo.com>.
Thanks for your response.  Unfortunately I don't have JMS as an option in
this case.

I suppose I'll just use a bean and xstream to save/load the information (was
hoping for some oft found camel magic).  thanks again.



--
View this message in context: http://camel.465427.n5.nabble.com/Message-Headers-to-file-component-tp5720327p5720341.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message Headers to file component?

Posted by Christian Müller <ch...@gmail.com>.
Any reason not to use JMS?
If you want to use the file component, you have to add the message headers
(end exchange properties) into the message body by yourself, as only the
body will be written to the hard drive. You can use a processor or bean to
archive this.

Best,
Christian

On Mon, Oct 1, 2012 at 9:01 PM, dunnlow <du...@yahoo.com> wrote:

> Hi, am trying to pass information between two camel apps via file.  I
> envisioned a way to redirect a message (body and headers) to a file and
> then
> have the second app consume that file as a message (just as if it had
> originated on the second system).
>
> I tried just sending the original message to the file component, but only
> the message gets output (no headers).  I figured the solution was to
> marshal
> to/from xstream but this just puts the message in xml (no headers again):
>
>   from ("direct:tofile").marshal().xstream().to("file:outbox");
>
> What is the easiest/best way to marshal a message (body and headers, dont
> need attachments) to a file?
>
> Thanks,
> -J
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Message-Headers-to-file-component-tp5720327.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--