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 2019/09/17 07:59:08 UTC

[camel] branch master updated (56c8773 -> db116e4)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 56c8773  Camel-Kubernetes: Fixed CS
     new 2b9a2ef  Revert "[CAMEL-13912] Remove access to the route when reifying the error handlers"
     new db116e4  CAMEL-13912: Reduce code that was not needed anymore. CAMEL-13984: The tests now pass.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/reifier/errorhandler/ErrorHandlerReifier.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


[camel] 02/02: CAMEL-13912: Reduce code that was not needed anymore. CAMEL-13984: The tests now pass.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit db116e473cb66f070d9a930b7544afd6b9589224
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Sep 17 08:33:48 2019 +0200

    CAMEL-13912: Reduce code that was not needed anymore. CAMEL-13984: The tests now pass.
---
 .../camel/reifier/errorhandler/ErrorHandlerReifier.java   | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
index 2a9b25c..df37929 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
@@ -34,6 +34,7 @@ import org.apache.camel.builder.ErrorHandlerBuilderSupport;
 import org.apache.camel.builder.NoErrorHandlerBuilder;
 import org.apache.camel.model.OnExceptionDefinition;
 import org.apache.camel.model.RedeliveryPolicyDefinition;
+import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.processor.ErrorHandler;
 import org.apache.camel.processor.errorhandler.ErrorHandlerSupport;
 import org.apache.camel.processor.errorhandler.ExceptionPolicy;
@@ -161,19 +162,11 @@ public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport>
         // the transacted error handler could have been configured on the route
         // so we should use that one
         if (!isErrorHandlerFactoryConfigured(ref)) {
-            // see if there has been configured a route builder on the route
+            // see if there has been configured a error handler builder on the route
+            // TODO: Avoid using RouteDefinition - tests should pass: https://issues.apache.org/jira/browse/CAMEL-13984
             RouteDefinition route = (RouteDefinition)routeContext.getRoute();
             answer = route.getErrorHandlerFactory();
-            if (answer == null && route.getErrorHandlerRef() != null) {
-                answer = routeContext.lookup(route.getErrorHandlerRef(), ErrorHandlerBuilder.class);
-            }
-            if (answer == null) {
-                // fallback to the default error handler if none configured on
-                // the route
-                answer = new DefaultErrorHandlerBuilder();
-            }
-            // check if its also a ref with no error handler configuration like
-            // me
+            // check if its also a ref with no error handler configuration like me
             if (answer instanceof ErrorHandlerBuilderRef) {
                 ErrorHandlerBuilderRef other = (ErrorHandlerBuilderRef)answer;
                 String otherRef = other.getRef();


[camel] 01/02: Revert "[CAMEL-13912] Remove access to the route when reifying the error handlers"

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2b9a2ef1eaab641c04a26779a659c77f848c14a5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Sep 17 08:18:52 2019 +0200

    Revert "[CAMEL-13912] Remove access to the route when reifying the error handlers"
    
    This reverts commit ee5b49fa1a327bcee09fae67f456c3c6ef7cc064.
---
 .../camel/reifier/errorhandler/ErrorHandlerReifier.java       | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
index 48a853e..2a9b25c 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
@@ -162,7 +162,16 @@ public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport>
         // so we should use that one
         if (!isErrorHandlerFactoryConfigured(ref)) {
             // see if there has been configured a route builder on the route
-            answer = routeContext.getErrorHandlerFactory();
+            RouteDefinition route = (RouteDefinition)routeContext.getRoute();
+            answer = route.getErrorHandlerFactory();
+            if (answer == null && route.getErrorHandlerRef() != null) {
+                answer = routeContext.lookup(route.getErrorHandlerRef(), ErrorHandlerBuilder.class);
+            }
+            if (answer == null) {
+                // fallback to the default error handler if none configured on
+                // the route
+                answer = new DefaultErrorHandlerBuilder();
+            }
             // check if its also a ref with no error handler configuration like
             // me
             if (answer instanceof ErrorHandlerBuilderRef) {