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-examples.git
The following commit(s) were added to refs/heads/main by this push: new 8a1113b Fix compilation errors in routeloader and YAML validation errors in routeloader/kamelet-main/routes-configuration (#61) 8a1113b is described below commit 8a1113b0b56d2c59c2708dde4d8f7be33097466b Author: Nicolas Filotto <essob...@users.noreply.github.com> AuthorDate: Fri Jan 28 13:04:30 2022 +0100 Fix compilation errors in routeloader and YAML validation errors in routeloader/kamelet-main/routes-configuration (#61) --- .../src/main/resources/camel/my-route.yaml | 11 +++++----- examples/routeloader/pom.xml | 6 ++++++ .../src/main/resources/myroutes/my-yaml-route.yaml | 19 ++++++++-------- .../src/main/resources/myroutes/my-yaml-route.yaml | 25 +++++++++++----------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/examples/kamelet-main/src/main/resources/camel/my-route.yaml b/examples/kamelet-main/src/main/resources/camel/my-route.yaml index cbe28c2..6de916e 100644 --- a/examples/kamelet-main/src/main/resources/camel/my-route.yaml +++ b/examples/kamelet-main/src/main/resources/camel/my-route.yaml @@ -1,7 +1,8 @@ - route: id: "earthquake" - from: "kamelet:earthquake-source" - steps: - - unmarshal: - json: {} - - log: "Earthquake with magnitude ${body[properties][mag]} at ${body[properties][place]}" + from: + uri: "kamelet:earthquake-source" + steps: + - unmarshal: + json: {} + - log: "Earthquake with magnitude ${body[properties][mag]} at ${body[properties][place]}" diff --git a/examples/routeloader/pom.xml b/examples/routeloader/pom.xml index 05e664d..aacbb4b 100644 --- a/examples/routeloader/pom.xml +++ b/examples/routeloader/pom.xml @@ -61,6 +61,12 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-java-joor-dsl</artifactId> </dependency> + <!-- the endpoint dsl to be able to dynamically compile MyRouteBuilder.java --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-endpointdsl</artifactId> + <scope>runtime</scope> + </dependency> <!-- xml-io with fast xml route loader --> <dependency> <groupId>org.apache.camel</groupId> diff --git a/examples/routeloader/src/main/resources/myroutes/my-yaml-route.yaml b/examples/routeloader/src/main/resources/myroutes/my-yaml-route.yaml index 74860cf..e58e2fa 100644 --- a/examples/routeloader/src/main/resources/myroutes/my-yaml-route.yaml +++ b/examples/routeloader/src/main/resources/myroutes/my-yaml-route.yaml @@ -16,12 +16,13 @@ ## --------------------------------------------------------------------------- - route: - from: "timer:yaml?period=3s" - steps: - - set-body: - simple: "Timer fired ${header.CamelTimerCounter} times" - - to: - uri: "log:yaml" - parameters: - show-body-type: false - show-exchange-pattern: false + from: + uri: "timer:yaml?period=3s" + steps: + - set-body: + simple: "Timer fired ${header.CamelTimerCounter} times" + - to: + uri: "log:yaml" + parameters: + show-body-type: false + show-exchange-pattern: false diff --git a/examples/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml b/examples/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml index 8816956..2d28a3a 100644 --- a/examples/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml +++ b/examples/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml @@ -18,15 +18,16 @@ - route: # refer to the route configuration by the id to use for this route route-configuration-id: "yamlError" - from: "timer:yaml?period=3s" - steps: - - set-body: - simple: "Timer fired ${header.CamelTimerCounter} times" - - to: - uri: "log:yaml" - parameters: - show-body-type: false - show-exchange-pattern: false - - throw-exception: - exception-type: "java.lang.IllegalArgumentException" - message: "Error from yaml" + from: + uri: "timer:yaml?period=3s" + steps: + - set-body: + simple: "Timer fired ${header.CamelTimerCounter} times" + - to: + uri: "log:yaml" + parameters: + show-body-type: false + show-exchange-pattern: false + - throw-exception: + exception-type: "java.lang.IllegalArgumentException" + message: "Error from yaml"