camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Refering implicitly to routeContext
Date Fri, 29 Mar 2013 08:14:53 GMT

Yeah maybe we should have a <routeContextScan pattern="foo*"/> or
something that can supporting looking up and adding any <routeContext>
that matches this pattern. Then you can have this "flexibility" you
are talking about.

Though it may get a little bit harder to implement as its during the
xml parsing, and usually you need to know the exact names of the
"elements" you refer to, so eg "foo*" is maybe hard to match and bind
to "foo-bar", "foo-cafe" if you have 2 <routeContext> with those ids.

So not sure if we can implement it like that, and have it work in both
spring and blueprint.

Though an alternative could be to add a "mandatory=true|false"
attribute to the existing <routeContextRef"> so you can tell it to
silently ignore if the routeContext wasn't found.

On Thu, Mar 28, 2013 at 4:25 PM, edvicif <> wrote:
> Hi
> I want to develop an interceptor, which I can turn on on demand using spring
> DSL, by adding the xml file to the spring configuration list.
> So what I want to have
> myInterceptor.xml
> <routeContext id="sg">
>   <interceptFrom uri="direct:something"/>
>   <to uri="..."/>
> </routeContext>
> Sometimes I want to run configs: normal-config.xml
> but sometimgs normal-config.xml,myInterceptor.xml
> I was only able to find examples, that I explicit refer to these context
> through:
> <routeContextRef ref="sg"/> in the camelContext node. But I want to avoid it
> as I don't want to modify the original camelContext definition.
> The camelContext has packageScan and contextScan function. I was able to
> achieve my goal with that to dynamically add route. Unfortunately I have to
> define the route using JAVA.
> Can I achieve somehow, that if I list of the XML files for Spring and
> contains route definitions beans they add them self to the camelContext?
> I understand there will be an issue, when I define multiple camel context.
> Other think I realized that if I want to define an interceptor in
> routeContext I must define a dummy from, to node before the interceptor
> definition. Am I doing something wrong here?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message