You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnanaguru S <gn...@gmail.com> on 2015/06/23 04:32:07 UTC

Idea on using Camel replaceFromWith for real routes

Howdy, 

AdviceWith is one of the great feature for unit testing camel routes. If
some of its capabilities are available for the actual routing, it will be a
great value add. 

I have a route which has a JMS from and some subsequent to uris &
processors. 

<route id="orchestration-routes">
   <from uri="JMS:queue:bla"/>
   <to uri="wiretap:something"/>
   <process ref="customProcessor" />
   <to uri="xslt:tranformer.xsl" />
</route>

I want to build another route with the same functionality, but with a
'direct' instead of a 'JMS'. 

Yes, I can create an additional route to cover this scenario. Something like
this:

<route id="jms-facade">
   <from uri="JMS:queue:bla"/>
   <to uri="direct:bla"/>
</route>

<route id="direct-orchestraion-backend">
   <from uri="direct:bla"/>
   <to uri="wiretap:something"/>
   <process ref="customProcessor" />
   <to uri="xslt:tranformer.xsl" />
</route>

Camel is always flexible, I can cover all kind of scenarios. But I thought
it will be more simple if we can do something like this:

<route id="clientRoute">
   <from uri="CXF:Gateway"/>
   *<to uri="direct:bla?replaceFromWith=orchestration-routes"/>*
</route>

Just a thought ! Better ideas are welcome :) Or it will be nice to know if
there is something which exist already. (Something using XML DSL please)

Regards
Guru



--
View this message in context: http://camel.465427.n5.nabble.com/Idea-on-using-Camel-replaceFromWith-for-real-routes-tp5768490.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Idea on using Camel replaceFromWith for real routes

Posted by Karel Bernolet <ka...@gmail.com>.
why don't you just add a second and/or third <from> clause in your original
route?

<route id="orchestration-routes">
   <from uri="JMS:queue:bla"/>
   <from uri="CXF:Gateway"/>
   <from uri="direct:bla"/>
   <to uri="wiretap:something"/>
   <process ref="customProcessor" />
   <to uri="xslt:tranformer.xsl" />
</route>

On Tue, Jun 23, 2015 at 4:32 AM, Gnanaguru S <gn...@gmail.com> wrote:

> Howdy,
>
> AdviceWith is one of the great feature for unit testing camel routes. If
> some of its capabilities are available for the actual routing, it will be a
> great value add.
>
> I have a route which has a JMS from and some subsequent to uris &
> processors.
>
> <route id="orchestration-routes">
>    <from uri="JMS:queue:bla"/>
>    <to uri="wiretap:something"/>
>    <process ref="customProcessor" />
>    <to uri="xslt:tranformer.xsl" />
> </route>
>
> I want to build another route with the same functionality, but with a
> 'direct' instead of a 'JMS'.
>
> Yes, I can create an additional route to cover this scenario. Something
> like
> this:
>
> <route id="jms-facade">
>    <from uri="JMS:queue:bla"/>
>    <to uri="direct:bla"/>
> </route>
>
> <route id="direct-orchestraion-backend">
>    <from uri="direct:bla"/>
>    <to uri="wiretap:something"/>
>    <process ref="customProcessor" />
>    <to uri="xslt:tranformer.xsl" />
> </route>
>
> Camel is always flexible, I can cover all kind of scenarios. But I thought
> it will be more simple if we can do something like this:
>
> <route id="clientRoute">
>    <from uri="CXF:Gateway"/>
>    *<to uri="direct:bla?replaceFromWith=orchestration-routes"/>*
> </route>
>
> Just a thought ! Better ideas are welcome :) Or it will be nice to know if
> there is something which exist already. (Something using XML DSL please)
>
> Regards
> Guru
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Idea-on-using-Camel-replaceFromWith-for-real-routes-tp5768490.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>