This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 859653d0a4c7aa5e84e4a688443a5abf433f3ccb Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 25 07:21:04 2021 +0200 CAMEL-16585: camel-kamelet - Main class to easily bootstrap Camel with Kamelets --- bom/camel-bom/pom.xml | 5 +++ .../org/apache/camel/catalog/docs.properties | 1 - .../apache/camel/catalog/docs/kamelet-main.adoc | 49 +++++++++++++++++++++ .../modules/others/pages/kamelet-main.adoc | 51 ++++++++++++++++++++++ 4 files changed, 105 insertions(+), 1 deletion(-) diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 9096c86..671a167 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -1169,6 +1169,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-kamelet-main</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-kamelet-reify</artifactId> <version>${project.version}</version> </dependency> diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties index ffd4ec8..8477780 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties @@ -271,7 +271,6 @@ jta kafka-component kamelet-component kamelet-eip -kamelet-main kamelet-reify-component kubernetes-config-maps-component kubernetes-custom-resources-component diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-main.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-main.adoc new file mode 100644 index 0000000..4e196d1 --- /dev/null +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/kamelet-main.adoc @@ -0,0 +1,49 @@ +[[kamelet-main-other]] += Kamelet Main Component +:docTitle: Kamelet Main +:artifactId: camel-kamelet-main +:description: Main to run Kamelet standalone +:since: 3.11 +:supportLevel: Preview +include::{cq-version}@camel-quarkus:ROOT:partial$reference/others/kamelet-main.adoc[opts=optional] + +*Since Camel {since}* + +A `main` class that is opinionated to boostrap and run Camel standalone with Kameleets for development and demo purposes. + +== Initial configuration + +The `KameletMain` is pre-configured with the following properties: + +[source,properties] +---- +camel.component.kamelet.location = classpath:/kamelets,github:apache:camel-kamelets +camel.main.routes-include-pattern = classpath:camel/* +camel.main.lightweight = true +---- + +These settings can be overridden by configuration in `application.properties`. + +== Automatic dependencies downloading + +The Kamelet Main can automatic download Kamelet YAML files from a remote location over http/https, and from github as well. + +The official Kameleets from the Apache Camel Kamelet Catalog is stored on github and they can be used out of the box as-is. + +For example a Camel route can be _coded_ in YAML which uses the Earthquake Kamelet from the catalog, as shown below: + +[source,yaml] +---- +- route: + from: "kamelet:earthquake-source" + steps: + - unmarshal: + json: {} + - log: "Earthquake with magnitude ${body[properties][mag]} at ${body[properties][place]}" +---- + +In this use-case the earthquake kamelet will be downloaded from github, and as well its required dependencies. + +You can find an example with this at +https://github.com/apache/camel-examples/tree/main/examples/kamelet-main[kamelet-main]. + diff --git a/docs/components/modules/others/pages/kamelet-main.adoc b/docs/components/modules/others/pages/kamelet-main.adoc new file mode 100644 index 0000000..8a42e5b --- /dev/null +++ b/docs/components/modules/others/pages/kamelet-main.adoc @@ -0,0 +1,51 @@ +[[kamelet-main-other]] += Kamelet Main Component +//THIS FILE IS COPIED: EDIT THE SOURCE FILE: +:page-source: dsl/camel-kamelet-main/src/main/docs/kamelet-main.adoc +:docTitle: Kamelet Main +:artifactId: camel-kamelet-main +:description: Main to run Kamelet standalone +:since: 3.11 +:supportLevel: Preview +include::{cq-version}@camel-quarkus:ROOT:partial$reference/others/kamelet-main.adoc[opts=optional] + +*Since Camel {since}* + +A `main` class that is opinionated to boostrap and run Camel standalone with Kameleets for development and demo purposes. + +== Initial configuration + +The `KameletMain` is pre-configured with the following properties: + +[source,properties] +---- +camel.component.kamelet.location = classpath:/kamelets,github:apache:camel-kamelets +camel.main.routes-include-pattern = classpath:camel/* +camel.main.lightweight = true +---- + +These settings can be overridden by configuration in `application.properties`. + +== Automatic dependencies downloading + +The Kamelet Main can automatic download Kamelet YAML files from a remote location over http/https, and from github as well. + +The official Kameleets from the Apache Camel Kamelet Catalog is stored on github and they can be used out of the box as-is. + +For example a Camel route can be _coded_ in YAML which uses the Earthquake Kamelet from the catalog, as shown below: + +[source,yaml] +---- +- route: + from: "kamelet:earthquake-source" + steps: + - unmarshal: + json: {} + - log: "Earthquake with magnitude ${body[properties][mag]} at ${body[properties][place]}" +---- + +In this use-case the earthquake kamelet will be downloaded from github, and as well its required dependencies. + +You can find an example with this at +https://github.com/apache/camel-examples/tree/main/examples/kamelet-main[kamelet-main]. +