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 2019/06/20 13:55:09 UTC

[GitHub] [camel-k-runtime] davsclaus commented on a change in pull request #84: Support full yaml dsl #80

davsclaus commented on a change in pull request #84: Support full yaml dsl #80
URL: https://github.com/apache/camel-k-runtime/pull/84#discussion_r295798105
 
 

 ##########
 File path: camel-k-runtime-yaml/README.adoc
 ##########
 @@ -0,0 +1,204 @@
+YAML DSL
+========
+
+This artifact provides a YAML based DSL for Apache Camel and Apache Camel K.
+
+[WARNING]
+====
+experimental
+====
+
+=== Defining a route
+
+A route is a sequence of elements, or `steps`, defined as follow:
+
+[source, yaml]
+----
+from: #<1>
+  uri: "direct:start"
+  steps: #<2>
+    - filter:
+        expression:
+          simple: "${in.header.continue} == true"
+        steps: #<2>
+          - to:
+              uri: "log:filtered"
+    - to:
+        uri: "log:original"
+----
+<1> route entry point, by default `from` and `rest` are supported
+<2> processing steps
+
+[NOTE]
+====
+Each step is represented by YAML map that has a single entry where the field name is the EIP name
+====
+
+As general rule each step provide all the parameters the related definition declares but there are some minor differences/enhancements:
+
+- *Output Aware Steps*
++
+Some steps such as `filter` and `split` have their own pipeline when an exchange matches the filter expression or for the items generated by the split expression, such pipeline can be defined by the `steps` field:
++
+[source, yaml]
+----
+filter:
+  expression:
+    simple: "${in.header.continue} == true"
+      steps:
+        - to:
+            uri: "log:filtered"
+----
++
+[NOTE]
+====
+if the `steps` field is omitted, then each subsequent step is considered part of the filter pipeline.
+====
+
+- *Expression Aware Steps*
++
+Some EIP such as `filter` and `split` supports the definition of an expression through the `expression` field:
++
+[source, yaml]
+.Explicit Expression field
+----
+filter:
+    expression:
+      simple: "${in.header.continue} == true"
+----
++
+To make the DSL less verbose, the `expression` field can be omitted:
++
+[source, yaml]
+.Implicit Expression field
+----
+filter:
+    simple: "${in.header.continue} == true"
+----
++
+In general expression can be defined inline like in the examples above but in case you need provide more information, you can 'unroll' the expression definition and  configure any single parameter the expression defines.
 
 Review comment:
   Double space in text

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services