You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/12/30 15:57:35 UTC
[camel-spring-boot-examples] branch main updated: PR for Jira CAMEL-17393 (#43)
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-spring-boot-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 0be1cad PR for Jira CAMEL-17393 (#43)
0be1cad is described below
commit 0be1cadf7f47c86651eb4d7f270c2d9256dc04e5
Author: javaduke <Eu...@modusbox.com>
AuthorDate: Thu Dec 30 08:57:30 2021 -0700
PR for Jira CAMEL-17393 (#43)
---
routes-configuration/pom.xml | 7 +++++++
routes-configuration/src/main/resources/application.yaml | 2 +-
routes-configuration/src/main/resources/myerror/xml-error.xml | 2 +-
.../xml-error.xml => myinterceptor/xml-interceptor.xml} | 10 ++++------
.../src/main/resources/myroutes/my-xml-route.xml | 2 +-
5 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/routes-configuration/pom.xml b/routes-configuration/pom.xml
index 2a24a7f..75e7d78 100644
--- a/routes-configuration/pom.xml
+++ b/routes-configuration/pom.xml
@@ -119,6 +119,13 @@
<artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- For debugging -->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-debug-starter</artifactId>
+ </dependency>
+
</dependencies>
<build>
diff --git a/routes-configuration/src/main/resources/application.yaml b/routes-configuration/src/main/resources/application.yaml
index 753776f..961d55f 100644
--- a/routes-configuration/src/main/resources/application.yaml
+++ b/routes-configuration/src/main/resources/application.yaml
@@ -29,4 +29,4 @@ camel:
dump-routes: true
# which directory(s) to scan for routes/route-configurations which can be xml, yaml or java files
- routes-include-pattern: classpath:myroutes/*,classpath:myerror/*
+ routes-include-pattern: classpath:myroutes/*,classpath:myerror/*,classpath:myinterceptor/*
diff --git a/routes-configuration/src/main/resources/myerror/xml-error.xml b/routes-configuration/src/main/resources/myerror/xml-error.xml
index 8184b2b..3c92779 100644
--- a/routes-configuration/src/main/resources/myerror/xml-error.xml
+++ b/routes-configuration/src/main/resources/myerror/xml-error.xml
@@ -22,6 +22,6 @@
<onException>
<exception>java.lang.Exception</exception>
<handled><constant>true</constant></handled>
- <log message="XML WARN: ${exception.message}"/>
+ <log message="XML WARN: ${exception.message}" id="inOnException"/>
</onException>
</routeConfiguration>
diff --git a/routes-configuration/src/main/resources/myerror/xml-error.xml b/routes-configuration/src/main/resources/myinterceptor/xml-interceptor.xml
similarity index 79%
copy from routes-configuration/src/main/resources/myerror/xml-error.xml
copy to routes-configuration/src/main/resources/myinterceptor/xml-interceptor.xml
index 8184b2b..f525b9d 100644
--- a/routes-configuration/src/main/resources/myerror/xml-error.xml
+++ b/routes-configuration/src/main/resources/myinterceptor/xml-interceptor.xml
@@ -18,10 +18,8 @@
-->
-<routeConfiguration id="xmlError">
- <onException>
- <exception>java.lang.Exception</exception>
- <handled><constant>true</constant></handled>
- <log message="XML WARN: ${exception.message}"/>
- </onException>
+<routeConfiguration id="xmlInterceptor">
+ <interceptFrom uri="*">
+ <log message="Message intercepted" id="inXmlInterceptor"/>
+ </interceptFrom>
</routeConfiguration>
diff --git a/routes-configuration/src/main/resources/myroutes/my-xml-route.xml b/routes-configuration/src/main/resources/myroutes/my-xml-route.xml
index a098857..de6877a 100644
--- a/routes-configuration/src/main/resources/myroutes/my-xml-route.xml
+++ b/routes-configuration/src/main/resources/myroutes/my-xml-route.xml
@@ -24,7 +24,7 @@
-->
<!-- refer to the route configuration by the id to use for this route -->
-<route routeConfigurationId="xmlError">
+<route routeConfigurationId="xmlError,xmlInterceptor">
<from uri="timer:xml?period=5s"/>
<log message="I am XML"/>
<throwException exceptionType="java.lang.Exception" message="Some kind of XML error"/>