nicolaferraro commented on issue #2117:
URL: https://github.com/apache/camel-k/issues/2117#issuecomment-797350177


   The route template part (i.e. the part that can use the property 
placeholders) in each Kamelet is a YAML flow, but a Kamelet can also hand-off 
processing to routes written in any of the other supported languages. E.g.
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: Kamelet
   metadata:
     name: java
     labels:
       camel.apache.org/kamelet.type: "source"
   spec:
     sources:
     - content: |
         // camel-k: language=java
   
         import org.apache.camel.builder.RouteBuilder;
   
         public class Source extends RouteBuilder {
           @Override
           public void configure() throws Exception {
   
               from("direct:java")
                 .setBody().exchangeProperty("prop1")
                 .log("Prop is ${body}");
   
           }
         }
       name: Source.java
     definition:
       title: "Example of Kamelet with Java"
       description: "Passes data to Java"
       properties:
         prop1:
           title: Property 1
           description: A property
           type: string
           default: "The value"
     flow:
       # The template is always YAML, but it can pass work to Java
       from:
         uri: timer:tick
         steps:
           - set-property:
               name: "prop1"
               constant: "{{prop1}}"
           - to: "direct:java"
           - to: "kamelet:sink"
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to