camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Calling Processor in Spring DSL
Date Mon, 14 Apr 2014 12:54:35 GMT
Hi

You can use the language component
http://camel.apache.org/language

And make sure to set transform=false.

Then you can essentially call a groovy script.

But remember XML is not a programming language, so writing code in XML
is not ideal.
You would need to use CDATA blocks or have to escape > and & signs and whatnot.



On Sun, Apr 13, 2014 at 11:38 AM, Max Bridgewater
<max.bridgewater@gmail.com> wrote:
> Hi,
>
> Does Spring DSL support Groovy in the processor construct? With Java DSL, I
> can do this:
>
> from("direct:test")
>       .process { Exchange exchange -> println (exchange.in.body) }
>       .process { println (it.in.body) }
>
>
> What about Spring DSL?
>
> I was hoping something like this would work:
>
> <process>
>     <groovy>Exchange exchange -> println (exchange.in.body)
> </groovy><process>
>
> Thoughts?
> Max



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message