camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bart Horré <b...@anova.be>
Subject Re: conditional uri
Date Tue, 23 Jul 2013 10:02:01 GMT
I often usen a mechanism to conditionally route based on test or production
environment where I load a spring property to identify the environment and
create the endpoints based on the environment.

In Java DSL you could make an abstract route builder to house the common
logic and write to direct: endpoint. You can then create a test or
production routebuilder based on the environment which would read from the
direct: endpoint and forward to the real endpoints


On Tue, Jul 16, 2013 at 9:49 PM, Jan Matèrne (jhm) <apache@materne.de>wrote:

> If your xml-route-definition is inside a spring configuration, spring
> properties should be possible.
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: Chris Wolf [mailto:cwolf.algo@gmail.com]
> > Gesendet: Dienstag, 16. Juli 2013 16:17
> > An: users@camel.apache.org
> > Betreff: Re: conditional uri
> >
> > It depends on what you mean by "conditional" -  if you mean conditional
> > at route-definition time, you can use property placeholders and/or
> > Language Expressions.
> >
> > If you mean conditional at runtime, then I'm pretty sure you can only
> > do that with producer endpoints (i.e. "to" endpoints) see:
> >
> > http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >
> > If you want conditional runtime consumer endpoints, the only solution I
> > have been able to come up with is dynamically created routes that are
> > created at runtime; this logic is encapsulated in a custom processor.
> >
> >     -Chris
> >
> >
> >
> >
> > On Tue, Jul 16, 2013 at 9:46 AM, boris <boris.shukhat@barclays.com>
> > wrote:
> > > How could I have a conditional uri string?
> > > For example,
> > > I have <from uri="prod_uri"   in production and <from
> > uri="direct:start"
> > > for testing.
> > > I want to have a single xml file for both and manage uri string
> > > conditionally.
> > > Thanks,
> > > Boris
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Bart Horré
Anova r&d bvba

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message