camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Calling route via direct that does an HTTP POST
Date Fri, 28 Feb 2014 07:17:48 GMT

So are you saying you want to call a route with direct, that reads a
file, and sends the file to a HTTP POST?

If so take a look at the content enricher EIP and the pollEnrich method

from direct
   to http

On Thu, Feb 27, 2014 at 8:18 PM, mister blinky <> wrote:
> If I have a route that i call from other routes (via "direct") that does an
> HTTP POST. How do I get the file that I want to post into the body of the
> message before invoking the .to("http://<url>")?
> The problem I'm facing is that, since every "from" in the route gets started
> when the route is started, starting this route starts the "direct" as well
> as the "file" consumer. I don't want to start a file consumer -- I just want
> to shove the contents of the file i want to POST into the message body of
> the .to("http://...").
>      from("direct:post")
>           .from("file:<dir>?fileName=<filename>")
>           .to("http://<url>")
>      .end();
> I suppose I could put an inline process that reads a file and sets it to the
> body of the exchange. But I would think there is a simpler way?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:
Make your Camel applications look hawt, try:

View raw message