You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Antoine DESSAIGNE <an...@gmail.com> on 2012/02/15 17:11:15 UTC

Spring DSL and external groovy file

Hi everyone,

I'm rather new to Camel and so far I'm loving it.

Right now I have to put my Groovy code within <groovy></groovy> tags. Is it
possible to use an external .groovy file instead ?

Thanks a lot,

Antoine.

Re: Spring DSL and external groovy file

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The language component can load scripts from files/classpath
http://camel.apache.org/language



On Wed, Feb 15, 2012 at 5:11 PM, Antoine DESSAIGNE
<an...@gmail.com> wrote:
> Hi everyone,
>
> I'm rather new to Camel and so far I'm loving it.
>
> Right now I have to put my Groovy code within <groovy></groovy> tags. Is it
> possible to use an external .groovy file instead ?
>
> Thanks a lot,
>
> Antoine.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Spring DSL and external groovy file

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Feb 15, 2012 at 5:11 PM, Antoine DESSAIGNE
<an...@gmail.com> wrote:
> Hi everyone,
>
> I'm rather new to Camel and so far I'm loving it.
>
> Right now I have to put my Groovy code within <groovy></groovy> tags. Is it
> possible to use an external .groovy file instead ?
>

We could possible improve the scripting language in Camel to support
loading scripts from file/classpath, if the script text starts with a
file: or classpath: that indicates its an external script file. So you
can do

<groovy>classpath:com/foo/myscript.groovy</groovy>

I guess it would then be obvious that you refer to a external script,
and not to a plain text with that value. If you want that then use the
<constant> instead.

Fell free to create a JIRA for this
http://camel.apache.org/support


> Thanks a lot,
>
> Antoine.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/