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: route from http to file, with Java DSL, howto?
Date Tue, 23 Mar 2010 07:23:45 GMT
On Tue, Mar 23, 2010 at 8:16 AM, Kameltreiber
<stefan.lorenz@htw-aalen.de> wrote:
>
> Hi,
> i just try to write a xml result from a http request to a file.
> I'd like to use Java DSL
> at the moment it looks like this
>
>  from("http://example.com/")
>        .setHeader(Exchange.FILE_NAME, constant("report.xml"))
>        .to("file:target/reports");
>
> I alreday checked the result, and there is one, but the report.xml never
> gets created.
> What am i doing wrong?
>

What do you want? is example.com a HTTP service you want to expose yourself?
Or do you want to poll data from an external HTTP service every X time?

If its the former then you gotta use Jetty in the from to let it be
used as the HTTP server.
http://camel.apache.org/jetty

  from("jetty:http://localhost:9080/")

If the latter you have to use a scheduler such as Timer or Quartz to
trigger the poll.


> Regards...
>
> --
> View this message in context: http://old.nabble.com/route-from-http-to-file%2C-with-Java-DSL%2C-howto--tp27997011p27997011.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message