You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tyler Durvik <ph...@gmail.com> on 2013/03/12 16:50:19 UTC

Route with 2 'from's

I have 2 routes in my system:

1. Gathers data and puts the data in a Camel cache endpoint.
2. Responds to HTTP GET requests using the Jetty endpoint.

My question is, I want to pull data from the cache to make up the
response to the GET.  How can I do this?  I think I would end up with
routes like this (pseudo-code obviously):

This route is straightforward.
<route1>
<from:uri="quartz:....." />
<!-- gather data -->
<to:uri="cache:..../>
</route1>

I'm confused on this one !!!
<route2>
<from:uri="jetty:...." />
<from:uri="cache:...." />  ?? wrong, but what is right ??
<!-- set cache data in body -->
</route2>

Re: Route with 2 'from's

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There is a GET operation you should use on the camel-cache component
http://camel.apache.org/cache.html

So in your 2nd route its something alike, and the key should be the
key from the 1st route

<to uri="cache:myCache?operation=GET&amp;key=myKey"/>


On Tue, Mar 12, 2013 at 4:50 PM, Tyler Durvik <ph...@gmail.com> wrote:
> I have 2 routes in my system:
>
> 1. Gathers data and puts the data in a Camel cache endpoint.
> 2. Responds to HTTP GET requests using the Jetty endpoint.
>
> My question is, I want to pull data from the cache to make up the
> response to the GET.  How can I do this?  I think I would end up with
> routes like this (pseudo-code obviously):
>
> This route is straightforward.
> <route1>
> <from:uri="quartz:....." />
> <!-- gather data -->
> <to:uri="cache:..../>
> </route1>
>
> I'm confused on this one !!!
> <route2>
> <from:uri="jetty:...." />
> <from:uri="cache:...." />  ?? wrong, but what is right ??
> <!-- set cache data in body -->
> </route2>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen