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 2009/12/04 17:48:40 UTC
svn commit: r887262 - in /camel/trunk:
camel-core/src/main/java/org/apache/camel/
camel-core/src/main/java/org/apache/camel/component/bean/
camel-core/src/main/java/org/apache/camel/model/
camel-core/src/main/java/org/apache/camel/processor/ camel-core...
Author: davsclaus
Date: Fri Dec 4 16:48:39 2009
New Revision: 887262
URL: http://svn.apache.org/viewvc?rev=887262&view=rev
Log:
CAMEL-2223: RecipientList now supports parallel, stopOnException and what else it can get hand on. Added option to @RecipientList to configure this as well.
Added:
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java (with props)
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java (with props)
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java (with props)
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java (with props)
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java (with props)
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java (with props)
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListParallelTest.java
- copied, changed from r887120, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java (with props)
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml (with props)
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml (with props)
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml (with props)
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml
- copied, changed from r887120, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListWithStringDelimitedHeader.xml
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/RecipientList.java
camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/RecipientList.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/RecipientList.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/RecipientList.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/RecipientList.java Fri Dec 4 16:48:39 2009
@@ -44,4 +44,9 @@
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR })
public @interface RecipientList {
String context() default "";
+ String delimiter() default ",";
+ boolean parallelProcessoing() default false;
+ boolean stopOnException() default false;
+ String strategyRef() default "";
+ String executorServiceRef() default "";
}
\ No newline at end of file
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java Fri Dec 4 16:48:39 2009
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.concurrent.ExecutorService;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
@@ -32,6 +33,8 @@
import org.apache.camel.NoTypeConversionAvailableException;
import org.apache.camel.Pattern;
import org.apache.camel.processor.RecipientList;
+import org.apache.camel.processor.aggregate.AggregationStrategy;
+import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -75,7 +78,22 @@
if (method.getAnnotation(org.apache.camel.RecipientList.class) != null
&& matchContext(method.getAnnotation(org.apache.camel.RecipientList.class).context())) {
- recipientList = new RecipientList();
+
+ org.apache.camel.RecipientList annotation = method.getAnnotation(org.apache.camel.RecipientList.class);
+
+ recipientList = new RecipientList(annotation.delimiter());
+ recipientList.setStopOnException(annotation.stopOnException());
+ recipientList.setParallelProcessing(annotation.parallelProcessoing());
+
+ if (ObjectHelper.isNotEmpty(annotation.executorServiceRef())) {
+ ExecutorService executor = CamelContextHelper.mandatoryLookup(camelContext, annotation.executorServiceRef(), ExecutorService.class);
+ recipientList.setExecutorService(executor);
+ }
+
+ if (ObjectHelper.isNotEmpty(annotation.strategyRef())) {
+ AggregationStrategy strategy = CamelContextHelper.mandatoryLookup(camelContext, annotation.strategyRef(), AggregationStrategy.class);
+ recipientList.setAggregationStrategy(strategy);
+ }
}
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java Fri Dec 4 16:48:39 2009
@@ -1063,10 +1063,10 @@
* @return the builder
*/
@SuppressWarnings("unchecked")
- public Type recipientList(Expression recipients) {
+ public RecipientListDefinition recipientList(Expression recipients) {
RecipientListDefinition answer = new RecipientListDefinition(recipients);
addOutput(answer);
- return (Type) this;
+ return answer;
}
/**
@@ -1078,11 +1078,11 @@
* @return the builder
*/
@SuppressWarnings("unchecked")
- public Type recipientList(Expression recipients, String delimiter) {
+ public RecipientListDefinition recipientList(Expression recipients, String delimiter) {
RecipientListDefinition answer = new RecipientListDefinition(recipients);
answer.setDelimiter(delimiter);
addOutput(answer);
- return (Type) this;
+ return answer;
}
/**
@@ -1091,12 +1091,10 @@
*
* @return the expression clause to configure the expression to decide the destinations
*/
- public ExpressionClause<ProcessorDefinition<Type>> recipientList() {
+ public ExpressionClause<RecipientListDefinition> recipientList() {
RecipientListDefinition answer = new RecipientListDefinition();
addOutput(answer);
- ExpressionClause<ProcessorDefinition<Type>> clause = new ExpressionClause<ProcessorDefinition<Type>>(this);
- answer.setExpression(clause);
- return clause;
+ return ExpressionClause.createAndSetExpression(answer);
}
/**
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java Fri Dec 4 16:48:39 2009
@@ -16,16 +16,23 @@
*/
package org.apache.camel.model;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import org.apache.camel.Expression;
import org.apache.camel.Processor;
import org.apache.camel.model.language.ExpressionDefinition;
import org.apache.camel.processor.RecipientList;
+import org.apache.camel.processor.aggregate.AggregationStrategy;
+import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.concurrent.ExecutorServiceHelper;
/**
* Represents an XML <recipientList/> element
@@ -36,8 +43,20 @@
@XmlAccessorType(XmlAccessType.FIELD)
public class RecipientListDefinition extends ExpressionNode {
+ @XmlTransient
+ private AggregationStrategy aggregationStrategy;
+ @XmlTransient
+ private ExecutorService executorService;
@XmlAttribute(required = false)
private String delimiter;
+ @XmlAttribute(required = false)
+ private Boolean parallelProcessing;
+ @XmlAttribute(required = false)
+ private String strategyRef;
+ @XmlAttribute(required = false)
+ private String executorServiceRef;
+ @XmlAttribute(required = false)
+ private Boolean stopOnException;
public RecipientListDefinition() {
}
@@ -64,13 +83,107 @@
public Processor createProcessor(RouteContext routeContext) throws Exception {
Expression expression = getExpression().createExpression(routeContext);
+ RecipientList answer;
if (delimiter != null) {
- return new RecipientList(expression, delimiter);
+ answer = new RecipientList(expression, delimiter);
} else {
- return new RecipientList(expression);
+ answer = new RecipientList(expression);
+ }
+
+ if (parallelProcessing != null) {
+ answer.setParallelProcessing(isParallelProcessing());
}
+ if (stopOnException != null) {
+ answer.setStopOnException(isStopOnException());
+ }
+
+ answer.setAggregationStrategy(createAggregationStrategy(routeContext));
+ answer.setExecutorService(createExecutorService(routeContext));
+
+ return answer;
}
+ private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
+ if (aggregationStrategy == null && strategyRef != null) {
+ aggregationStrategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
+ }
+ if (aggregationStrategy == null) {
+ // fallback to use latest
+ aggregationStrategy = new UseLatestAggregationStrategy();
+ }
+ return aggregationStrategy;
+ }
+
+ private ExecutorService createExecutorService(RouteContext routeContext) {
+ if (executorService == null && executorServiceRef != null) {
+ executorService = routeContext.lookup(executorServiceRef, ExecutorService.class);
+ }
+ if (executorService == null) {
+ // fall back and use default
+ executorService = ExecutorServiceHelper.newScheduledThreadPool(10, "RecipientList", true);
+ }
+ return executorService;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<ProcessorDefinition> getOutputs() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public void addOutput(ProcessorDefinition processorType) {
+ // add it to the parent as a recipient list does not support outputs
+ getParent().addOutput(processorType);
+ }
+
+ // Fluent API
+ // -------------------------------------------------------------------------
+
+ /**
+ * Set the aggregationStrategy
+ *
+ * @return the builder
+ */
+ public RecipientListDefinition aggregationStrategy(AggregationStrategy aggregationStrategy) {
+ setAggregationStrategy(aggregationStrategy);
+ return this;
+ }
+
+ /**
+ * Doing the splitting work in parallel
+ *
+ * @return the builder
+ */
+ public RecipientListDefinition parallelProcessing() {
+ setParallelProcessing(true);
+ return this;
+ }
+
+ /**
+ * Will now stop further processing if an exception occurred during processing of an
+ * {@link org.apache.camel.Exchange} and the caused exception will be thrown.
+ * <p/>
+ * The default behavior is to <b>not</b> stop but continue processing till the end
+ *
+ * @return the builder
+ */
+ public RecipientListDefinition stopOnException() {
+ setStopOnException(true);
+ return this;
+ }
+
+ /**
+ * Setting the executor service for executing the sending to the recipients.
+ *
+ * @param executorService the executor service
+ * @return the builder
+ */
+ public RecipientListDefinition executorService(ExecutorService executorService) {
+ setExecutorService(executorService);
+ return this;
+ }
+
// Properties
//-------------------------------------------------------------------------
@@ -81,4 +194,52 @@
public void setDelimiter(String delimiter) {
this.delimiter = delimiter;
}
+
+ public Boolean isParallelProcessing() {
+ return parallelProcessing;
+ }
+
+ public void setParallelProcessing(Boolean parallelProcessing) {
+ this.parallelProcessing = parallelProcessing;
+ }
+
+ public String getStrategyRef() {
+ return strategyRef;
+ }
+
+ public void setStrategyRef(String strategyRef) {
+ this.strategyRef = strategyRef;
+ }
+
+ public String getExecutorServiceRef() {
+ return executorServiceRef;
+ }
+
+ public void setExecutorServiceRef(String executorServiceRef) {
+ this.executorServiceRef = executorServiceRef;
+ }
+
+ public Boolean isStopOnException() {
+ return stopOnException;
+ }
+
+ public void setStopOnException(Boolean stopOnException) {
+ this.stopOnException = stopOnException;
+ }
+
+ public AggregationStrategy getAggregationStrategy() {
+ return aggregationStrategy;
+ }
+
+ public void setAggregationStrategy(AggregationStrategy aggregationStrategy) {
+ this.aggregationStrategy = aggregationStrategy;
+ }
+
+ public ExecutorService getExecutorService() {
+ return executorService;
+ }
+
+ public void setExecutorService(ExecutorService executorService) {
+ this.executorService = executorService;
+ }
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java Fri Dec 4 16:48:39 2009
@@ -17,7 +17,6 @@
package org.apache.camel.model;
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -32,6 +31,7 @@
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.concurrent.ExecutorServiceHelper;
/**
* Represents an XML <split/> element
@@ -109,8 +109,7 @@
executorService = routeContext.lookup(executorServiceRef, ExecutorService.class);
}
if (executorService == null) {
- // fall back and use default
- executorService = Executors.newScheduledThreadPool(5);
+ executorService = ExecutorServiceHelper.newScheduledThreadPool(10, "Split", true);
}
return executorService;
}
@@ -196,6 +195,9 @@
return this;
}
+ // Properties
+ //-------------------------------------------------------------------------
+
public AggregationStrategy getAggregationStrategy() {
return aggregationStrategy;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java?rev=887262&r1=887261&r2=887262&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java Fri Dec 4 16:48:39 2009
@@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.concurrent.ExecutorService;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
@@ -27,6 +28,7 @@
import org.apache.camel.Producer;
import org.apache.camel.impl.ProducerCache;
import org.apache.camel.impl.ServiceSupport;
+import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
import org.apache.camel.util.ExchangeHelper;
import org.apache.camel.util.ObjectHelper;
@@ -43,12 +45,20 @@
private ProducerCache producerCache;
private Expression expression;
private final String delimiter;
+ private boolean parallelProcessing;
+ private boolean stopOnException;
+ private ExecutorService executorService;
+ private AggregationStrategy aggregationStrategy = new UseLatestAggregationStrategy();
public RecipientList() {
// use comma by default as delimiter
this.delimiter = ",";
}
+ public RecipientList(String delimiter) {
+ this.delimiter = delimiter;
+ }
+
public RecipientList(Expression expression) {
// use comma by default as delimiter
this(expression, ",");
@@ -76,6 +86,7 @@
*/
public void sendToRecipientList(Exchange exchange, Object receipientList) throws Exception {
Iterator<Object> iter = ObjectHelper.createIterator(receipientList, delimiter);
+
List<Processor> processors = new ArrayList<Processor>();
while (iter.hasNext()) {
Object recipient = iter.next();
@@ -83,7 +94,11 @@
Producer producer = getProducerCache(exchange).getProducer(endpoint);
processors.add(producer);
}
- MulticastProcessor mp = new MulticastProcessor(processors, new UseLatestAggregationStrategy());
+
+ MulticastProcessor mp = new MulticastProcessor(processors, getAggregationStrategy(), isParallelProcessing(),
+ getExecutorService(), false, isStopOnException());
+
+ // now let the multicast process the exchange
mp.process(exchange);
}
@@ -116,4 +131,35 @@
}
}
+ public boolean isParallelProcessing() {
+ return parallelProcessing;
+ }
+
+ public void setParallelProcessing(boolean parallelProcessing) {
+ this.parallelProcessing = parallelProcessing;
+ }
+
+ public boolean isStopOnException() {
+ return stopOnException;
+ }
+
+ public void setStopOnException(boolean stopOnException) {
+ this.stopOnException = stopOnException;
+ }
+
+ public ExecutorService getExecutorService() {
+ return executorService;
+ }
+
+ public void setExecutorService(ExecutorService executorService) {
+ this.executorService = executorService;
+ }
+
+ public AggregationStrategy getAggregationStrategy() {
+ return aggregationStrategy;
+ }
+
+ public void setAggregationStrategy(AggregationStrategy aggregationStrategy) {
+ this.aggregationStrategy = aggregationStrategy;
+ }
}
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,53 @@
+/**
+ * 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;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision$
+ */
+public class RecipientListAggregationStrategyTest extends ContextTestSupport {
+
+ public void testRecipientListAggregationStrategy() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedBodiesReceived("a+b+c");
+
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "direct:a,direct:b,direct:c");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .recipientList(header("foo")).aggregationStrategy(new BodyInAggregatingStrategy())
+ .to("mock:result");
+
+ from("direct:a").transform(constant("a"));
+ from("direct:b").transform(constant("b"));
+ from("direct:c").transform(constant("c"));
+ }
+ };
+ }
+
+}
\ No newline at end of file
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListAggregationStrategyTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,60 @@
+/**
+ * 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.CamelExecutionException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * @version $Revision$
+ */
+public class RecipientListDoNotStopOnExceptionTest extends ContextTestSupport {
+
+ public void testRecipientListDoNotStopOnException() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(0);
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:b").expectedMessageCount(1);
+ getMockEndpoint("mock:c").expectedMessageCount(1);
+
+ try {
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "direct:a,direct:b,direct:c");
+ fail("Should have thrown exception");
+ } catch (CamelExecutionException e) {
+ assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
+ assertEquals("Damn", e.getCause().getMessage());
+ }
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .recipientList(header("foo"))
+ .to("mock:result");
+
+ from("direct:a").to("mock:a");
+ from("direct:b").to("mock:b").throwException(new IllegalArgumentException("Damn"));
+ from("direct:c").to("mock:c");
+ }
+ };
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListDoNotStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,51 @@
+/**
+ * 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;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision$
+ */
+public class RecipientListParallelTest extends ContextTestSupport {
+
+ public void testRecipientListParallel() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedBodiesReceived("c", "b", "a");
+
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "direct:a,direct:b,direct:c");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .recipientList(header("foo")).aggregationStrategy();
+
+ from("direct:a").delay(1000).transform(constant("a")).to("mock:result");
+ from("direct:b").delay(500).transform(constant("b")).to("mock:result");
+ from("direct:c").transform(constant("c")).to("mock:result");
+ }
+ };
+ }
+}
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,62 @@
+/**
+ * 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.CamelExchangeException;
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * @version $Revision$
+ */
+public class RecipientListStopOnExceptionTest extends ContextTestSupport {
+
+ public void testRecipientListStopOnException() throws Exception {
+ getMockEndpoint("mock:result").expectedMessageCount(0);
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:b").expectedMessageCount(1);
+ getMockEndpoint("mock:c").expectedMessageCount(0);
+
+ try {
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "direct:a,direct:b,direct:c");
+ fail("Should have thrown exception");
+ } catch (CamelExecutionException e) {
+ assertIsInstanceOf(CamelExchangeException.class, e.getCause());
+ assertIsInstanceOf(IllegalArgumentException.class, e.getCause().getCause());
+ assertEquals("Damn", e.getCause().getCause().getMessage());
+ }
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .recipientList(header("foo")).stopOnException()
+ .to("mock:result");
+
+ from("direct:a").to("mock:a");
+ from("direct:b").to("mock:b").throwException(new IllegalArgumentException("Damn"));
+ from("direct:c").to("mock:c");
+ }
+ };
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.RecipientListAggregationStrategyTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringRecipientListAggregationStrategyTest extends RecipientListAggregationStrategyTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this,
+ "org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml");
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListAggregationStrategyTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.RecipientListDoNotStopOnExceptionTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringRecipientListDoNotStopOnExceptionTest extends RecipientListDoNotStopOnExceptionTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this,
+ "org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml");
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListDoNotStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListParallelTest.java (from r887120, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListParallelTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListParallelTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java&r1=887120&r2=887262&rev=887262&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListParallelTest.java Fri Dec 4 16:48:39 2009
@@ -17,12 +17,14 @@
package org.apache.camel.spring.processor;
import org.apache.camel.CamelContext;
-import org.apache.camel.processor.routingslip.RoutingSlipTest;
+import org.apache.camel.processor.RecipientListParallelTest;
+
import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-public class SpringRoutingSlipTest extends RoutingSlipTest {
+public class SpringRecipientListParallelTest extends RecipientListParallelTest {
+
protected CamelContext createCamelContext() throws Exception {
return createSpringCamelContext(this,
- "org/apache/camel/spring/processor/routingSlip.xml");
+ "org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml");
}
-}
+}
\ No newline at end of file
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java Fri Dec 4 16:48:39 2009
@@ -0,0 +1,30 @@
+/**
+ * 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.RecipientListStopOnExceptionTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringRecipientListStopOnExceptionTest extends RecipientListStopOnExceptionTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this,
+ "org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml");
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListStopOnExceptionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml Fri Dec 4 16:48:39 2009
@@ -0,0 +1,54 @@
+<?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-2.5.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+
+ <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <recipientList strategyRef="agg">
+ <header>foo</header>
+ </recipientList>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="direct:a"/>
+ <transform><constant>a</constant></transform>
+ </route>
+
+ <route>
+ <from uri="direct:b"/>
+ <transform><constant>b</constant></transform>
+ </route>
+
+ <route>
+ <from uri="direct:c"/>
+ <transform><constant>c</constant></transform>
+ </route>
+
+ </camelContext>
+
+ <bean id="agg" class="org.apache.camel.processor.BodyInAggregatingStrategy"/>
+
+</beans>
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListAggregationStrategyTest.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml Fri Dec 4 16:48:39 2009
@@ -0,0 +1,57 @@
+<?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-2.5.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+
+ <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <recipientList>
+ <header>foo</header>
+ </recipientList>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="direct:a"/>
+ <to uri="mock:a"/>
+ </route>
+
+ <route>
+ <from uri="direct:b"/>
+ <to uri="mock:b"/>
+ <throwException ref="damn"/>
+ </route>
+
+ <route>
+ <from uri="direct:c"/>
+ <to uri="mock:c"/>
+ </route>
+
+ </camelContext>
+
+ <bean id="damn" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
+
+</beans>
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListDoNotStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml?rev=887262&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml Fri Dec 4 16:48:39 2009
@@ -0,0 +1,57 @@
+<?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-2.5.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+
+ <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <recipientList stopOnException="true">
+ <header>foo</header>
+ </recipientList>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="direct:a"/>
+ <to uri="mock:a"/>
+ </route>
+
+ <route>
+ <from uri="direct:b"/>
+ <to uri="mock:b"/>
+ <throwException ref="damn"/>
+ </route>
+
+ <route>
+ <from uri="direct:c"/>
+ <to uri="mock:c"/>
+ </route>
+
+ </camelContext>
+
+ <bean id="damn" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
+
+</beans>
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/RecipientListStopOnExceptionTest.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml (from r887120, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListWithStringDelimitedHeader.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListWithStringDelimitedHeader.xml&r1=887120&r2=887262&rev=887262&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListWithStringDelimitedHeader.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelTest.xml Fri Dec 4 16:48:39 2009
@@ -22,20 +22,35 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
- <!--
- from("direct:a").recipientList(header("myHeader").tokenize(","));
- -->
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
- <!-- START SNIPPET: e1 -->
- <route>
- <from uri="direct:a" />
- <!-- use comma as a delimiter for String based values -->
- <recipientList delimiter=",">
- <header>myHeader</header>
- </recipientList>
- </route>
- <!-- END SNIPPET: e1 -->
+ <route>
+ <from uri="direct:start"/>
+ <recipientList parallelProcessing="true">
+ <header>foo</header>
+ </recipientList>
+ </route>
+
+ <route>
+ <from uri="direct:a"/>
+ <delay><constant>1000</constant></delay>
+ <transform><constant>a</constant></transform>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="direct:b"/>
+ <delay><constant>500</constant></delay>
+ <transform><constant>b</constant></transform>
+ <to uri="mock:result"/>
+ </route>
+
+ <route>
+ <from uri="direct:c"/>
+ <transform><constant>c</constant></transform>
+ <to uri="mock:result"/>
+ </route>
+
</camelContext>
</beans>