From 59c1a10ed0aa9f4412d03cd63f89de6cccaa9c87 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Mon, 28 Sep 2020 09:57:07 +0200 Subject: [PATCH] yaml dsl: add documentation for endpoint-dsl support #484 --- docs/modules/languages/pages/yaml.adoc | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/docs/modules/languages/pages/yaml.adoc b/docs/modules/languages/pages/yaml.adoc index c94e563ba..65af46821 100644 --- a/docs/modules/languages/pages/yaml.adoc +++ b/docs/modules/languages/pages/yaml.adoc @@ -112,6 +112,57 @@ set-body: In case you want to use the data-format's default settings, you need to place an empty block as data format parameters, like `json: {}` ==== +== Defining endpoints + +To define an endpoint with the YAML dsl you have three options: + +. Using a classic Camel URI: ++ +[source,yaml] +---- +- from: + uri: "timer:tick?period=1s" + steps: + - to: + uri: "telegram:bots?authorizationToken=XXX" +---- +. Using URI and parameters: ++ +[source,yaml] +---- +- from: + uri: "timer://tick" + parameters: + period: "1s" + steps: + - to: + uri: "telegram:bots" + parameters: + authorizationToken: "XXX" +---- +. Using the YAML implementation of the https://camel.apache.org/manual/latest/Endpoint-dsl.html[Endpoint DSL]: ++ +[source,yaml] +---- +- from: + timer: + name: "tick" + period: "1s" + steps: + - telegram: + type: "bots" + authorizationToken: "XXX" +---- + +[WARNING] +==== +Support for the Endpoint DSL with YAML is experimental and subject to changes. +==== +[NOTE] +==== +Support for Endpoint DSL auto completion https://github.com/apache/camel-k-runtime/issues/485[is not yet available]. +==== + == Defining beans In addition to the general support for creating beans provided by https://camel.apache.org/components/latest/others/main.html#_specifying_custom_beans[Camel Main], the YAML DSL provide a convenient syntax to define and configure them: