camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remco Schoen <R.Sch...@topdesk.com>
Subject Groovy DSL - expression closures
Date Tue, 15 Aug 2017 12:26:29 GMT
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() }


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message