You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2018/09/27 07:31:13 UTC

[GitHub] lburgazzoli commented on a change in pull request #133: runtime: initial support for kotlin runtime

lburgazzoli commented on a change in pull request #133: runtime: initial support for kotlin runtime
URL: https://github.com/apache/camel-k/pull/133#discussion_r220819629
 
 

 ##########
 File path: runtime/examples/routes.kts
 ##########
 @@ -0,0 +1,19 @@
+//
+// To run this integrations use:
+//
+//     kamel run -d kamel-runtime-kotlin runtime/examples/routes.kts
+//
+
+val rnd = java.util.Random()
+val builder = bindings["builder"] as org.apache.camel.builder.RouteBuilder
+fun from(uri: String): org.apache.camel.model.RouteDefinition = builder.from(uri)
 
 Review comment:
   At the moment the kotlin implementation for the jsr 223 does not allow to provide global scoped objects and we need to get them through the `bindings` map. With kotlin 1.3 there will be a better support for scripting so there is a change those lines won't be needed any more.
   
   I've also asked kotlin people to give some advice about providing global bindingsso I'll update this as soon as I have some feedback.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services