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 2015/05/10 12:49:39 UTC
[1/7] camel git commit: CAMEL-8763: Default error handler should use
default redelivery delay of 1 sec
Repository: camel
Updated Branches:
refs/heads/master 9f8d3cdae -> 6470fb38b
CAMEL-8763: Default error handler should use default redelivery delay of 1 sec
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5af0fe47
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5af0fe47
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5af0fe47
Branch: refs/heads/master
Commit: 5af0fe47cd1aaf48e086bc9932f28637074137f7
Parents: 9f8d3cd
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 09:44:27 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 09:44:27 2015 +0200
----------------------------------------------------------------------
.../java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/5af0fe47/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
index c879cca..96a408e 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
@@ -523,7 +523,6 @@ public class DefaultErrorHandlerBuilder extends ErrorHandlerBuilderSupport {
protected RedeliveryPolicy createRedeliveryPolicy() {
RedeliveryPolicy policy = new RedeliveryPolicy();
policy.disableRedelivery();
- policy.setRedeliveryDelay(0);
return policy;
}
[5/7] camel git commit: CAMEL-8755: No Message History on
deadLetterChannel
Posted by da...@apache.org.
CAMEL-8755: No Message History on deadLetterChannel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/55fe6ef1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/55fe6ef1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/55fe6ef1
Branch: refs/heads/master
Commit: 55fe6ef16abf50340ae984a4feb6be4d309c6d10
Parents: f40a200
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 11:46:48 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 11:46:48 2015 +0200
----------------------------------------------------------------------
.../handler/ErrorHandlerDefinitionParser.java | 21 ++++++++--
...erChannelLogExhaustedMessageHistoryTest.java | 32 +++++++++++++++
...orHandlerLogExhaustedMessageHistoryTest.java | 32 +++++++++++++++
...terChannelLogExhaustedMessageHistoryTest.xml | 42 ++++++++++++++++++++
...rorHandlerLogExhaustedMessageHistoryTest.xml | 42 ++++++++++++++++++++
5 files changed, 166 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/55fe6ef1/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
index 65ae81a..dde1229 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
@@ -35,8 +35,7 @@ import org.springframework.util.StringUtils;
* The DefinitionParser to deal with the ErrorHandler
*/
public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
- protected BeanDefinitionParser redeliveryPolicyParser = new RedeliveryPolicyDefinitionParser(CamelRedeliveryPolicyFactoryBean.class);
-
+
public ErrorHandlerDefinitionParser() {
// need to override the default
super(null, false);
@@ -94,6 +93,8 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
throw new IllegalArgumentException("Cannot set both redeliveryPolicyRef and redeliveryPolicy,"
+ " only one allowed, in error handler with id: " + id);
}
+ boolean deadLetter = type.equals(ErrorHandlerType.DeadLetterChannel);
+ BeanDefinitionParser redeliveryPolicyParser = new RedeliveryPolicyDefinitionParser(CamelRedeliveryPolicyFactoryBean.class, deadLetter);
BeanDefinition redeliveryPolicyDefinition = redeliveryPolicyParser.parse(childElement, parserContext);
builder.addPropertyValue(localName, redeliveryPolicyDefinition);
}
@@ -194,13 +195,27 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
protected class RedeliveryPolicyDefinitionParser extends BeanDefinitionParser {
- public RedeliveryPolicyDefinitionParser(Class<?> type) {
+ private final boolean deadLetter;
+
+ public RedeliveryPolicyDefinitionParser(Class<?> type, boolean deadLetter) {
super(type, false);
+ this.deadLetter = deadLetter;
}
protected boolean shouldGenerateId() {
return true;
}
+
+ protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
+ super.doParse(element, parserContext, builder);
+
+ // if dead letter then set logExhaustedMessageHistory default false if not explicit configured
+ boolean hasLogExhaustedMessageHistory = element.hasAttribute("logExhaustedMessageHistory");
+ if (deadLetter && !hasLogExhaustedMessageHistory) {
+ builder.addPropertyValue("logExhaustedMessageHistory", "false");
+ }
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/55fe6ef1/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelLogExhaustedMessageHistoryTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..ff1a861
--- /dev/null
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDeadLetterChannelLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.processor.DeadLetterChannelLogExhaustedMessageHistoryTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ * @version
+ */
+public class SpringDeadLetterChannelLogExhaustedMessageHistoryTest extends DeadLetterChannelLogExhaustedMessageHistoryTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.xml");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/55fe6ef1/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerLogExhaustedMessageHistoryTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..01f1624
--- /dev/null
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.processor.DefaultErrorHandlerLogExhaustedMessageHistoryTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ * @version
+ */
+public class SpringDefaultErrorHandlerLogExhaustedMessageHistoryTest extends DefaultErrorHandlerLogExhaustedMessageHistoryTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/55fe6ef1/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 0000000..00eef48
--- /dev/null
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/spring">
+
+ <errorHandler id="eh" type="DeadLetterChannel" deadLetterUri="mock:dead">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/55fe6ef1/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 0000000..7af32c1
--- /dev/null
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/spring">
+
+ <errorHandler id="eh">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</beans>
[3/7] camel git commit: CAMEL-8763: Default error handler should use
default redelivery delay of 1 sec
Posted by da...@apache.org.
CAMEL-8763: Default error handler should use default redelivery delay of 1 sec
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/710670e4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/710670e4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/710670e4
Branch: refs/heads/master
Commit: 710670e4559effd1b2238c1f3d4ab66d4fd8c5dd
Parents: f8871a2
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 10:22:34 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 10:22:34 2015 +0200
----------------------------------------------------------------------
.../camel/management/ManagedErrorHandlerRedeliveryTest.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/710670e4/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
index 4bc9e54..275d6bf 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedErrorHandlerRedeliveryTest.java
@@ -56,7 +56,7 @@ public class ManagedErrorHandlerRedeliveryTest extends ManagementTestSupport {
assertEquals(60000, delay.longValue());
delay = (Long) mbeanServer.getAttribute(on, "RedeliveryDelay");
- assertEquals(0, delay.longValue());
+ assertEquals(1000, delay.longValue());
String camelId = (String) mbeanServer.getAttribute(on, "CamelId");
assertEquals("camel-1", camelId);
@@ -124,7 +124,6 @@ public class ManagedErrorHandlerRedeliveryTest extends ManagementTestSupport {
} catch (CamelExecutionException e) {
IllegalArgumentException cause = assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
assertEquals("Forced", cause.getMessage());
-
}
assertEquals(1, counter);
@@ -145,7 +144,7 @@ public class ManagedErrorHandlerRedeliveryTest extends ManagementTestSupport {
public void process(Exchange exchange) throws Exception {
counter++;
if (counter < 3) {
- throw new IllegalArgumentException("Forced");
+ throw new IllegalArgumentException("Forced");
}
}
}).to("mock:result");
[7/7] camel git commit: CAMEL-8755: No Message History on
deadLetterChannel
Posted by da...@apache.org.
CAMEL-8755: No Message History on deadLetterChannel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6470fb38
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6470fb38
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6470fb38
Branch: refs/heads/master
Commit: 6470fb38bdc5d62e4efa647890005d5f2f166d0f
Parents: d3b56df
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 12:41:55 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 12:44:42 2015 +0200
----------------------------------------------------------------------
.../camel/builder/DeadLetterChannelBuilder.java | 9 ---------
.../handler/ErrorHandlerDefinitionParser.java | 21 +++-----------------
2 files changed, 3 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6470fb38/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
index f598d51..646ed2d 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
@@ -23,7 +23,6 @@ import org.apache.camel.NoSuchEndpointException;
import org.apache.camel.Processor;
import org.apache.camel.processor.DeadLetterChannel;
import org.apache.camel.processor.FatalFallbackErrorHandler;
-import org.apache.camel.processor.RedeliveryPolicy;
import org.apache.camel.processor.SendProcessor;
import org.apache.camel.spi.RouteContext;
import org.apache.camel.util.CamelLogger;
@@ -96,14 +95,6 @@ public class DeadLetterChannelBuilder extends DefaultErrorHandlerBuilder {
}
}
- @Override
- protected RedeliveryPolicy createRedeliveryPolicy() {
- RedeliveryPolicy answer = new RedeliveryPolicy();
- // do not log exhausted message history by default for DLC
- answer.setLogExhaustedMessageHistory(false);
- return answer;
- }
-
protected CamelLogger createLogger() {
return new CamelLogger(LoggerFactory.getLogger(DeadLetterChannel.class), LoggingLevel.ERROR);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/6470fb38/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
index dde1229..65ae81a 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java
@@ -35,7 +35,8 @@ import org.springframework.util.StringUtils;
* The DefinitionParser to deal with the ErrorHandler
*/
public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
-
+ protected BeanDefinitionParser redeliveryPolicyParser = new RedeliveryPolicyDefinitionParser(CamelRedeliveryPolicyFactoryBean.class);
+
public ErrorHandlerDefinitionParser() {
// need to override the default
super(null, false);
@@ -93,8 +94,6 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
throw new IllegalArgumentException("Cannot set both redeliveryPolicyRef and redeliveryPolicy,"
+ " only one allowed, in error handler with id: " + id);
}
- boolean deadLetter = type.equals(ErrorHandlerType.DeadLetterChannel);
- BeanDefinitionParser redeliveryPolicyParser = new RedeliveryPolicyDefinitionParser(CamelRedeliveryPolicyFactoryBean.class, deadLetter);
BeanDefinition redeliveryPolicyDefinition = redeliveryPolicyParser.parse(childElement, parserContext);
builder.addPropertyValue(localName, redeliveryPolicyDefinition);
}
@@ -195,27 +194,13 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser {
protected class RedeliveryPolicyDefinitionParser extends BeanDefinitionParser {
- private final boolean deadLetter;
-
- public RedeliveryPolicyDefinitionParser(Class<?> type, boolean deadLetter) {
+ public RedeliveryPolicyDefinitionParser(Class<?> type) {
super(type, false);
- this.deadLetter = deadLetter;
}
protected boolean shouldGenerateId() {
return true;
}
-
- protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
- super.doParse(element, parserContext, builder);
-
- // if dead letter then set logExhaustedMessageHistory default false if not explicit configured
- boolean hasLogExhaustedMessageHistory = element.hasAttribute("logExhaustedMessageHistory");
- if (deadLetter && !hasLogExhaustedMessageHistory) {
- builder.addPropertyValue("logExhaustedMessageHistory", "false");
- }
- }
-
}
}
[4/7] camel git commit: CAMEL-8755: No Message History on
deadLetterChannel
Posted by da...@apache.org.
CAMEL-8755: No Message History on deadLetterChannel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f40a200c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f40a200c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f40a200c
Branch: refs/heads/master
Commit: f40a200ca582ea76691871512227fe4489cabe5e
Parents: 710670e
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 10:52:01 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 10:52:01 2015 +0200
----------------------------------------------------------------------
.../camel/builder/DeadLetterChannelBuilder.java | 5 ++-
.../camel/processor/RedeliveryErrorHandler.java | 11 +++--
...erChannelLogExhaustedMessageHistoryTest.java | 46 +++++++++++++++++++
...orHandlerLogExhaustedMessageHistoryTest.java | 47 ++++++++++++++++++++
4 files changed, 105 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f40a200c/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
index d7a9d3b..f598d51 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
@@ -98,7 +98,10 @@ public class DeadLetterChannelBuilder extends DefaultErrorHandlerBuilder {
@Override
protected RedeliveryPolicy createRedeliveryPolicy() {
- return new RedeliveryPolicy();
+ RedeliveryPolicy answer = new RedeliveryPolicy();
+ // do not log exhausted message history by default for DLC
+ answer.setLogExhaustedMessageHistory(false);
+ return answer;
}
protected CamelLogger createLogger() {
http://git-wip-us.apache.org/repos/asf/camel/blob/f40a200c/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
index 062ad6a..e4cf1b5 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
@@ -41,6 +41,7 @@ import org.apache.camel.util.AsyncProcessorConverterHelper;
import org.apache.camel.util.AsyncProcessorHelper;
import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.CamelLogger;
+import org.apache.camel.util.EndpointHelper;
import org.apache.camel.util.EventHelper;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.MessageHelper;
@@ -952,7 +953,11 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
String msg = "Failed delivery for " + ExchangeHelper.logIds(exchange);
msg = msg + ". Exhausted after delivery attempt: " + data.redeliveryCounter + " caught: " + caught;
if (processor != null) {
- msg = msg + ". Processed by failure processor: " + processor;
+ if (isDeadLetterChannel && deadLetterUri != null) {
+ msg = msg + ". Handled by DeadLetterChannel: [" + URISupport.sanitizeUri(deadLetterUri) + "]";
+ } else {
+ msg = msg + ". Processed by failure processor: " + processor;
+ }
}
// log that we failed delivery as we are exhausted
@@ -1052,8 +1057,8 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
}
// if we should not rollback, then check whether logging is enabled
- if (!newException && handled && !data.currentRedeliveryPolicy.isLogHandled()) {
- // do not log handled
+ if (!newException && handled && (!data.currentRedeliveryPolicy.isLogHandled() && !data.currentRedeliveryPolicy.isLogExhaustedMessageHistory())) {
+ // do not log handled (but log exhausted message history can overrule log handled)
return;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/f40a200c/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.java b/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..f691b25
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+public class DeadLetterChannelLogExhaustedMessageHistoryTest extends ContextTestSupport {
+
+ public void testLogExhaustedMessageHistory() throws Exception {
+ getMockEndpoint("mock:dead").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ // no delay to speedup test
+ errorHandler(deadLetterChannel("mock:dead").redeliveryDelay(0).maximumRedeliveries(3).logExhaustedMessageHistory(true));
+
+ from("direct:start")
+ .log("Incoming ${body}")
+ .throwException(new IllegalArgumentException("Forced"));
+ }
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/f40a200c/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java b/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..aec7b37
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+public class DefaultErrorHandlerLogExhaustedMessageHistoryTest extends ContextTestSupport {
+
+ public void testLogExhaustedMessageHistory() throws Exception {
+ try {
+ template.sendBody("direct:start", "Hello World");
+ fail("Should fail");
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ // no delay to speedup test
+ errorHandler(defaultErrorHandler().redeliveryDelay(0).maximumRedeliveries(3).logExhaustedMessageHistory(true));
+
+ from("direct:start")
+ .log("Incoming ${body}")
+ .throwException(new IllegalArgumentException("Forced"));
+ }
+ };
+ }
+}
[2/7] camel git commit: Polished test
Posted by da...@apache.org.
Polished test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f8871a23
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f8871a23
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f8871a23
Branch: refs/heads/master
Commit: f8871a2389104cb71280f18b144f367c7dc78058
Parents: 5af0fe4
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 10:22:13 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 10:22:13 2015 +0200
----------------------------------------------------------------------
.../camel/processor/aggregator/AggregateTimeoutTest.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f8871a23/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
index 27ad9ec..f07003c 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
@@ -42,10 +42,8 @@ public class AggregateTimeoutTest extends ContextTestSupport {
template.sendBodyAndHeader("direct:start", "A", "id", 123);
template.sendBodyAndHeader("direct:start", "B", "id", 123);
- // wait 3 seconds so that the timeout kicks in
- Thread.sleep(3000);
-
- mock.assertIsSatisfied();
+ // wait about 4 seconds so that the timeout kicks in but it was discarded
+ mock.assertIsSatisfied(4000);
// should invoke the timeout method
assertEquals(1, invoked.get());
[6/7] camel git commit: CAMEL-8755: No Message History on
deadLetterChannel
Posted by da...@apache.org.
CAMEL-8755: No Message History on deadLetterChannel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d3b56df6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d3b56df6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d3b56df6
Branch: refs/heads/master
Commit: d3b56df6665b05a71f44b5e27745cc3697ff8213
Parents: 55fe6ef
Author: Claus Ibsen <da...@apache.org>
Authored: Sun May 10 12:41:03 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun May 10 12:41:03 2015 +0200
----------------------------------------------------------------------
.../camel/processor/RedeliveryErrorHandler.java | 33 ++++++++++------
.../camel/processor/RedeliveryPolicy.java | 13 ++++++-
...erChannelLogExhaustedMessageHistoryTest.java | 33 ++++++++++++++++
...orHandlerLogExhaustedMessageHistoryTest.java | 38 ++++++++++++++++++
...terChannelLogExhaustedMessageHistoryTest.xml | 41 ++++++++++++++++++++
...rorHandlerLogExhaustedMessageHistoryTest.xml | 41 ++++++++++++++++++++
6 files changed, 187 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
index e4cf1b5..dbb87da 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
@@ -362,7 +362,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
// did previous processing cause an exception?
boolean handle = shouldHandleException(exchange);
if (handle) {
- handleException(exchange, data);
+ handleException(exchange, data, isDeadLetterChannel());
}
// compute if we are exhausted, and whether redelivery is allowed
@@ -536,7 +536,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
// did previous processing cause an exception?
boolean handle = shouldHandleException(exchange);
if (handle) {
- handleException(exchange, data);
+ handleException(exchange, data, isDeadLetterChannel());
}
// compute if we are exhausted or not
@@ -695,7 +695,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
return null;
}
- protected void prepareExchangeForContinue(Exchange exchange, RedeliveryData data) {
+ protected void prepareExchangeForContinue(Exchange exchange, RedeliveryData data, boolean isDeadLetterChannel) {
Exception caught = exchange.getException();
// we continue so clear any exceptions
@@ -718,7 +718,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
msg = msg + ". Handled and continue routing.";
// log that we failed but want to continue
- logFailedDelivery(false, false, false, true, exchange, msg, data, null);
+ logFailedDelivery(false, false, false, isDeadLetterChannel, true, exchange, msg, data, null);
}
protected void prepareExchangeForRedelivery(Exchange exchange, RedeliveryData data) {
@@ -760,7 +760,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
}
}
- protected void handleException(Exchange exchange, RedeliveryData data) {
+ protected void handleException(Exchange exchange, RedeliveryData data, boolean isDeadLetterChannel) {
Exception e = exchange.getException();
// store the original caused exception in a property, so we can restore it later
@@ -802,7 +802,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
if (!ExchangeHelper.isFailureHandled(exchange) && !ExchangeHelper.isUnitOfWorkExhausted(exchange)) {
String msg = "Failed delivery for " + ExchangeHelper.logIds(exchange)
+ ". On delivery attempt: " + data.redeliveryCounter + " caught: " + e;
- logFailedDelivery(true, false, false, false, exchange, msg, data, e);
+ logFailedDelivery(true, false, false, false, isDeadLetterChannel, exchange, msg, data, e);
}
data.redeliveryCounter = incrementRedeliveryCounter(exchange, e, data);
@@ -961,7 +961,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
}
// log that we failed delivery as we are exhausted
- logFailedDelivery(false, false, handled, false, exchange, msg, data, null);
+ logFailedDelivery(false, false, handled, false, isDeadLetterChannel, exchange, msg, data, null);
return sync;
}
@@ -992,7 +992,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
if (shouldContinue) {
log.trace("This exchange is continued: {}", exchange);
// okay we want to continue then prepare the exchange for that as well
- prepareExchangeForContinue(exchange, data);
+ prepareExchangeForContinue(exchange, data, isDeadLetterChannel);
} else if (shouldHandle) {
log.trace("This exchange is handled so its marked as not failed: {}", exchange);
exchange.setProperty(Exchange.ERRORHANDLER_HANDLED, Boolean.TRUE);
@@ -1015,7 +1015,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
} else {
msg += ". The new exception is not handled as deadLetterHandleNewException=false.";
}
- logFailedDelivery(false, true, handled, false, exchange, msg, data, newException);
+ logFailedDelivery(false, true, handled, false, isDeadLetterChannel, exchange, msg, data, newException);
}
if (handled) {
@@ -1044,7 +1044,7 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
}
}
- private void logFailedDelivery(boolean shouldRedeliver, boolean newException, boolean handled, boolean continued,
+ private void logFailedDelivery(boolean shouldRedeliver, boolean newException, boolean handled, boolean continued, boolean isDeadLetterChannel,
Exchange exchange, String message, RedeliveryData data, Throwable e) {
if (logger == null) {
return;
@@ -1057,7 +1057,18 @@ public abstract class RedeliveryErrorHandler extends ErrorHandlerSupport impleme
}
// if we should not rollback, then check whether logging is enabled
- if (!newException && handled && (!data.currentRedeliveryPolicy.isLogHandled() && !data.currentRedeliveryPolicy.isLogExhaustedMessageHistory())) {
+
+ // depending on what kind of error handler we should
+ boolean logExhausted;
+ if (isDeadLetterChannel) {
+ // if DLC then log exhausted should not be default
+ logExhausted = data.currentRedeliveryPolicy.getLogExhaustedMessageHistory() != null && data.currentRedeliveryPolicy.isLogExhaustedMessageHistory();
+ } else {
+ // for any other error handler log exhausted should be default
+ logExhausted = data.currentRedeliveryPolicy.getLogExhaustedMessageHistory() == null || data.currentRedeliveryPolicy.isLogExhaustedMessageHistory();
+ }
+
+ if (!newException && handled && (!data.currentRedeliveryPolicy.isLogHandled() && !logExhausted)) {
// do not log handled (but log exhausted message history can overrule log handled)
return;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
index b8bb24c..4b33a4b 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
@@ -97,7 +97,7 @@ public class RedeliveryPolicy implements Cloneable, Serializable {
protected boolean logContinued;
protected boolean logExhausted = true;
protected boolean logNewException = true;
- protected boolean logExhaustedMessageHistory = true;
+ protected Boolean logExhaustedMessageHistory;
protected boolean logRetryAttempted = true;
protected String delayPattern;
protected boolean asyncDelayedRedelivery;
@@ -687,6 +687,17 @@ public class RedeliveryPolicy implements Cloneable, Serializable {
}
public boolean isLogExhaustedMessageHistory() {
+ // should default be enabled
+ return logExhaustedMessageHistory == null || logExhaustedMessageHistory;
+ }
+
+ /**
+ * Whether the option logExhaustedMessageHistory has been configured or not
+ *
+ * @return <tt>null</tt> if not configured, or the configured value as true or false
+ * @see #isLogExhaustedMessageHistory()
+ */
+ public Boolean getLogExhaustedMessageHistory() {
return logExhaustedMessageHistory;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..00bd095
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.blueprint;
+
+import org.junit.Test;
+
+public class DeadLetterChannelLogExhaustedMessageHistoryTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml";
+ }
+
+ @Test
+ public void testLogExhaustedMessageHistory() throws Exception {
+ template.sendBody("direct:start", "Hello World");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
new file mode 100644
index 0000000..6680d09
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.blueprint;
+
+import org.junit.Test;
+
+public class DefaultErrorHandlerLogExhaustedMessageHistoryTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml";
+ }
+
+ @Test
+ public void testLogExhaustedMessageHistory() throws Exception {
+ try {
+ template.sendBody("direct:start", "Hello World");
+ fail("Should fail");
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 0000000..d6a925e
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DeadLetterChannelLogExhaustedMessageHistoryTest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh" type="DeadLetterChannel" deadLetterUri="mock:dead">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+
http://git-wip-us.apache.org/repos/asf/camel/blob/d3b56df6/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
new file mode 100644
index 0000000..ffb3f8a
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/DefaultErrorHandlerLogExhaustedMessageHistoryTest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <bean id="forced" class="java.lang.IllegalArgumentException">
+ <argument index="0" value="Forced"/>
+ </bean>
+
+ <camelContext errorHandlerRef="eh" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <errorHandler id="eh">
+ <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="0" logExhaustedMessageHistory="true"/>
+ </errorHandler>
+
+ <route>
+ <from uri="direct:start"/>
+ <log message="Incoming ${body}"/>
+ <throwException ref="forced"/>
+ </route>
+ </camelContext>
+
+</blueprint>
+