Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AEF2D1809D for ; Sun, 3 Jan 2016 16:56:21 +0000 (UTC) Received: (qmail 3065 invoked by uid 500); 3 Jan 2016 16:56:21 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 2920 invoked by uid 500); 3 Jan 2016 16:56:21 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 2757 invoked by uid 99); 3 Jan 2016 16:56:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jan 2016 16:56:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33011E01F4; Sun, 3 Jan 2016 16:56:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sun, 03 Jan 2016 16:56:26 -0000 Message-Id: <8a00e32b6ff14b198ba90d12a2ce1dff@git.apache.org> In-Reply-To: <40c0c9ac57674c53a7796c101d0333ea@git.apache.org> References: <40c0c9ac57674c53a7796c101d0333ea@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/7] camel git commit: CAMEL-9470: Add missing bridgeErrorHandler option to component docs 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/ae75d8d1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ae75d8d1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ae75d8d1 Branch: refs/heads/camel-2.16.x Commit: ae75d8d1533e9e32315904c107588f2d9798cf18 Parents: 2f01cf1 Author: Claus Ibsen Authored: Sun Jan 3 15:12:54 2016 +0100 Committer: Claus Ibsen Committed: Sun Jan 3 17:54:14 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/ae75d8d1/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. + *

+ * 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