Hi Claus,

Thanks a lot for the insight. My objective was to create a content based
router using information stored in an external file. I inject the
information into an array field using Spring, and so far the route appears
to be working.

But your explanation does give me something to think about, and I guess I
have to test my code further. I'll do so and post back my findings.

Once again, thanks.

Kind Regards,
Okello Nelson.


On Fri, Apr 12, 2013 at 11:28 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> The code in the configure() method of a RouteBuilder is only executed
> once, when Camel startup and build the route from what you defined in
> the configure method.
>
> So at runtime you need to use languages
> http://camel.apache.org/languages
>
> Or a java bean / camel processor / create your own predicate / etc. to
> have this evaluation work.
>
>
> On Thu, Apr 11, 2013 at 3:17 PM, Okello Nelson <cn.oke...@gmail.com>
> wrote:
> > Hi guys,
> >
> > I have the following route DSL:
> >
> > from("file:" + autoLoadBaseDir + "?move=.classified")
> >                 .loop(fileTypes.length)
> >                     .choice()
> >
> >
> .when(header("CamelFileName").contains(fileTypes[Integer.valueOf("${CamelLoopIndex}")]))
> >                             .to("file:" + classesBaseDir + "/" +
> > fileTypes[Integer.valueOf("${CamelLoopIndex}")]);
> >
> > I'm trying to use the loop index with an array to create a content based
> > router. However, the "${CamelLoopIndex"} seems like its not being
> resolved.
> > Is there something that I'm doing wrong? Thanks in advance.
> >
> > Kind Regards,
> > Okello Nelson.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



-- 
Kind Regards,
Okello Nelson
+254 722 137 826
cn.oke...@gmail.com

Reply via email to