You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dnvycumt <41...@qq.com> on 2016/03/24 10:13:30 UTC

one route how to call another route?

Hi,
from a web service, I want to return some file content to response:
   <route>
        <from uri="jetty:http://0.0.0.0:9081"/>
        <if possible call another route such as route_id="read-file">
    </route>
    <route>
      <from uri="file:src/data?noop=true"/>
      <to ..... />
    </route>



--
View this message in context: http://camel.465427.n5.nabble.com/one-route-how-to-call-another-route-tp5779618.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: one route how to call another route?

Posted by Claus Ibsen <cl...@gmail.com>.
Use the content enricher EIP to pickup the file from your servlet route
http://camel.apache.org/content-enricher.html

Use the pollEnrich for consuming the file.

To call other routes, use the direct component and link them together.

But in your use-case the correct solution is pollEnrich.

Or you can also just do a message transformation and set the body to a
java.io.File type with the name of the file to pickup



On Thu, Mar 24, 2016 at 10:13 AM, dnvycumt <41...@qq.com> wrote:
> Hi,
> from a web service, I want to return some file content to response:
>    <route>
>         <from uri="jetty:http://0.0.0.0:9081"/>
>         <if possible call another route such as route_id="read-file">
>     </route>
>     <route>
>       <from uri="file:src/data?noop=true"/>
>       <to ..... />
>     </route>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/one-route-how-to-call-another-route-tp5779618.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2