Hi

Yeah wonder why it cannot infer it as Exchange?

You can take a peak at the unit tests of camel-groovy to see some examples
https://github.com/apache/camel/tree/master/components/camel-groovy

And the docs for groovy dsl is here
https://camel.apache.org/groovy-dsl.html

Though you can try with

.process{ Exchange e -> println e.in.body}




On Fri, Jul 19, 2013 at 4:15 AM, vinay <vinay_samu...@yahoo.com> wrote:
> Thanks Claus, that fixed it.....but have another problem
>
> now, I changed route as follows and I get exception for .process closure
> class MyRouteBuilder extends org.apache.camel.builder.RouteBuilder {
>   void configure() {
>     from("direct://foo")
>      .to("log://camelLogger?level=INFO")
>      .process { println it.in.body }
>      .to("mock://result?retainLast=10")
>   }
> }
>
> Caught: groovy.lang.MissingMethodException: No signature of method:
> org.apache.camel.model.RouteDefinition.process() is applicable for argument
> types: (MyRouteBuilder$_configure_closure1) values:
> [MyRouteBuilder$_configure_closure1@6af5e140
> ]
> Possible solutions: process(org.apache.camel.Processor),
> processRef(java.lang.String)
> groovy.lang.MissingMethodException: No signature of method:
> org.apache.camel.mod
> el.RouteDefinition.process() is applicable for argument types:
> (MyRouteBuilder$_
> configure_closure1) values: [MyRouteBuilder$_configure_closure1@6af5e140]
> Possible solutions: process(org.apache.camel.Processor),
> processRef(java.lang.St
> ring)
>         at MyRouteBuilder.configure(CallCallista1.groovy:10)
>         at
> org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)
>         at
> org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)
>         at
> org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)
>         at
> org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:650)
>         at org.apache.camel.CamelContext$addRoutes.call(Unknown Source)
>         at CallCallista1.run(CallCallista1.groovy:20)
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-error-with-simple-program-with-camel-core-2-11-1-jar-tp5735829p5735880.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Reply via email to