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: Groovy DSL - expression closures
Date Wed, 23 Aug 2017 05:33:58 GMT
Hi

The groovy DSL is deprecated and its not recommended to be used. We
have also deprecated Scala DSL as well.

Sorry but there is only as few we can maintain which is Java and XML.



On Tue, Aug 15, 2017 at 2:26 PM, Remco Schoen <R.Schoen@topdesk.com> wrote:
> Hi,
>
> I’m trying to get processor closures to work as described on:
> http://camel.apache.org/groovy-dsl.html
>
> But when I put the code below in a groovy file, it gives an error.
>
> Should this work?
>
> Kind regards,
>
> Remco Schoen
>
> The error:
>
> groovy.lang.MissingMethodException: No signature of method: simpletest$1$_configure_closure1.doCall()
is applicable for argument types: (org.apache.camel.impl.DefaultExchange, java.lang.Class)
values: , ...]
> Possible solutions: doCall(), doCall(java.lang.Object), findAll(), findAll()
> at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:286)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
> at groovy.lang.Closure.call(Closure.java:414)
> at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
> at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
> at com.sun.proxy.$Proxy11.evaluate(Unknown Source)
> at org.apache.camel.processor.SetPropertyProcessor.process(SetPropertyProcessor.java:51)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:197)
> at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:79)
> at java.util.TimerThread.mainLoop(Timer.java:555)
> at java.util.TimerThread.run(Timer.java:505)
>
>
> The script:
>
> @Grab('org.apache.camel:camel-core:2.19.1')
> @Grab('org.slf4j:slf4j-simple:1.6.6')
> import org.apache.camel.*
> import org.apache.camel.impl.*
> import org.apache.camel.builder.*
>
> def camelContext = new DefaultCamelContext()
> camelContext.addRoutes(new RouteBuilder() {
>     def void configure() {
>         from("timer://jdkTimer?period=3000")
>                 .to("log://camelLogger?level=INFO")
>                 .setProperty('henk') { 'aaa' }
>     }
> })
> camelContext.start()
>
> addShutdownHook{ camelContext.stop() }
> synchronized(this){ this.wait() }
>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message