On Wed, Feb 13, 2013 at 10:12 AM, kiranreddykasa <kirankuma...@fss.co.in> wrote: > > Can anyone tell me how to build camel route dynamically in dsl. > > I am aware of recepientlist, dynamic router. > > Suppose I have a list of endpoint url's, how can i build route by iterating > the list ?? > > List<ObjectWithTypeAndURl> listOfEndpoints=............ > > In Route builder configure method can i define a single route in multiple > steps??? > > for eg.. > > from(listOfEndpoints.get(0)); > iterating > to(listOfEndpoints.get(..)); > > > something like this?? >
Yeah remember its just Java code. So you can use for loops / if .. else constructs etc. But you would need to use variables to break up the DSL and add to it later. See this unit test for an example https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/management/BigRouteTest.java > > > > > ----- > Regards > > kiran Reddy > -- > View this message in context: > http://camel.465427.n5.nabble.com/building-route-in-java-dsl-tp5727483.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- 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