On 04/10/2007, Nicky Sandhu <[EMAIL PROTECTED]> wrote:
> What would be really cool is to write only the routing code as a DSL in Java
> have the container wrap it up in a camel context (either existing or a new
> one)
> E.g. the user would write something like
>
> from("jms:myqueue").process(xslt("myxslt.xsl")).to("file:mydir");
>
> and the container would wrap that in a RouteBuilder and add it to a new or
> existing CamelContext.The thing is, thats not actually Java without the class declaration :). To get all the nice IDE completion; we'd need that line inside a method in a class for a Java IDE. We could support just the routing as a DSL in groovy or ruby (I've kinda started some experiments in that direction in the camel-ruby and camel-groovy modules). Or we could actually write a real DSL - a very early attempt here: https://svn.apache.org/repos/asf/activemq/camel/ide/camel-eclipse/ which has little of the actual Antlr grammar there; but at least it generates a nice text based editor in eclipse :) > Ditto for xml config as well. Yeah, the XML is much easier; we could just allow routes to be specified in a separate file to the main spring.xml and included. <!-- routes.xml --> <routes xmlns="..."> <route> <from uri="activemq:someQueue"/> <to uri="xmpp:someRoom"/> </route> </routes> <!-- spring.xml --> ... <camelContext xmlns="..."> <import uri="routes.xml"/> </camelContext> > This would help in separation of roles of a Camel Extender (extends Camel) > to a Camel User (writes routing rules) Yeah. In the pure XML world, I can see the separation between system configuration (data sources, JMS providers etc) with the routing rules; which may be semi-dynamic at runtime etc. -- James ------- http://macstrac.blogspot.com/ Open Source SOA http://open.iona.com
