CAMEL-6407: Include message history in stacktraces from error handler, making it easier to know where the problem was. Work in progress.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ea3d7dc8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ea3d7dc8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ea3d7dc8 Branch: refs/heads/master Commit: ea3d7dc8efd9f0646c904e2080d21fd2217b5be6 Parents: c2311c5 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri May 31 14:12:24 2013 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri May 31 14:12:24 2013 +0200 ---------------------------------------------------------------------- .../SpringMessageHistoryDumpRoutingTest.java | 32 +++++++++ .../processor/MessageHistoryDumpRoutingTest.xml | 53 +++++++++++++++ 2 files changed, 85 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/ea3d7dc8/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringMessageHistoryDumpRoutingTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringMessageHistoryDumpRoutingTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringMessageHistoryDumpRoutingTest.java new file mode 100644 index 0000000..42d7c8a --- /dev/null +++ b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringMessageHistoryDumpRoutingTest.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.MessageHistoryDumpRoutingTest; + +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; + +/** + * @version + */ +public class SpringMessageHistoryDumpRoutingTest extends MessageHistoryDumpRoutingTest { + + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, "org/apache/camel/spring/processor/MessageHistoryDumpRoutingTest.xml"); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/ea3d7dc8/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/MessageHistoryDumpRoutingTest.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/MessageHistoryDumpRoutingTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/MessageHistoryDumpRoutingTest.xml new file mode 100644 index 0000000..3a5cd34 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/MessageHistoryDumpRoutingTest.xml @@ -0,0 +1,53 @@ +<?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 to dump message history"/> + </bean> + + <!-- START SNIPPET: e1 --> + <camelContext messageHistory="true" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="seda:start"/> + <to uri="log:foo"/> + <to uri="direct:bar"/> + <delay> + <constant>300</constant> + <to uri="log:baz"/> + <throwException ref="forced"/> + <to uri="mock:result"/> + </delay> + </route> + + <route> + <from uri="direct:bar"/> + <to uri="log:bar"/> + <delay> + <constant>100</constant> + <to uri="mock:bar"/> + </delay> + </route> + </camelContext> + +</beans>