camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [8/9] camel git commit: CAMEL-9470: Add missing bridgeErrorHandler option to component docs
Date Sun, 03 Jan 2016 14:28:30 GMT
CAMEL-9470: Add missing bridgeErrorHandler option to component docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bfc39e0b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bfc39e0b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bfc39e0b

Branch: refs/heads/master
Commit: bfc39e0b996a308ac98e2c4e1e276d7efbe5c163
Parents: 946ed73
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Jan 3 15:12:54 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Jan 3 15:12:54 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/impl/DefaultEndpoint.java  | 25 +++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bfc39e0b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
index 24d7f6e..0bf9e74 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
@@ -59,6 +59,10 @@ public abstract class DefaultEndpoint extends ServiceSupport implements
Endpoint
     private EndpointConfiguration endpointConfiguration;
     private CamelContext camelContext;
     private Component component;
+    @UriParam(label = "consumer", optionalPrefix = "consumer.", description = "Allows for
bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred
while"
+                    + " the consumer is trying to pickup incoming messages, or the likes,
will now be processed as a message and handled by the routing Error Handler."
+                    + " By default the consumer will use the org.apache.camel.spi.ExceptionHandler
to deal with exceptions,that by default will be logged at WARN/ERROR level and ignored.")
+    private boolean bridgeErrorHandler;
     @UriParam(defaultValue = "InOnly", label = "advanced",
             description = "Sets the default exchange pattern when creating an exchange")
     private ExchangePattern exchangePattern = ExchangePattern.InOnly;
@@ -277,6 +281,22 @@ public abstract class DefaultEndpoint extends ServiceSupport implements
Endpoint
         this.synchronous = synchronous;
     }
 
+    public boolean isBridgeErrorHandler() {
+        return bridgeErrorHandler;
+    }
+
+    /**
+     * Allows for bridging the consumer to the Camel routing Error Handler, which mean any
exceptions occurred while
+     * the consumer is trying to pickup incoming messages, or the likes, will now be processed
as a message and
+     * handled by the routing Error Handler.
+     * <p/>
+     * By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
with exceptions,
+     * that by default will be logged at WARN/ERROR level and ignored.
+     */
+    public void setBridgeErrorHandler(boolean bridgeErrorHandler) {
+        this.bridgeErrorHandler = bridgeErrorHandler;
+    }
+
     /**
      * Gets the {@link org.apache.camel.PollingConsumer} queue size, when {@link org.apache.camel.impl.EventDrivenPollingConsumer}
      * is being used. Notice some Camel components may have their own implementation of {@link
org.apache.camel.PollingConsumer} and
@@ -476,7 +496,10 @@ public abstract class DefaultEndpoint extends ServiceSupport implements
Endpoint
 
     @Override
     protected void doStart() throws Exception {
-        // noop
+        // the bridgeErrorHandler was orignally configured as consumer.bridgeErrorHandler
so map to that style
+        if (bridgeErrorHandler) {
+            getConsumerProperties().put("bridgeErrorHandler", "true");
+        }
     }
 
     @Override


Mime
View raw message