This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 793500a CAMEL-16279: camel-core - Optimize core to reduce object
allocations by pooloing reusable tasks in the routing engine.
793500a is described below
commit 793500a9c776f84309f2577af0b4eb332ca93154
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Mar 9 20:44:26 2021 +0100
CAMEL-16279: camel-core - Optimize core to reduce object allocations by
pooloing reusable tasks in the routing engine.
---
.../TransactedStackSizeParallelProcessingTest.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git
a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeParallelProcessingTest.java
b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeParallelProcessingTest.java
index d229ea3..5f84854 100644
---
a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeParallelProcessingTest.java
+++
b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeParallelProcessingTest.java
@@ -16,7 +16,10 @@
*/
package org.apache.camel.spring.interceptor;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.engine.PrototypeExchangeFactory;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.RepeatedTest;
@@ -25,6 +28,14 @@ public class TransactedStackSizeParallelProcessingTest
extends TransactionClient
private static final boolean PRINT_STACK_TRACE = false;
private int total = 100;
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext context = super.createCamelContext();
+ // must use prototype scoped exchange factory
+ context.adapt(ExtendedCamelContext.class).setExchangeFactory(new
PrototypeExchangeFactory());
+ return context;
+ }
+
// to test for flaky when using parallel processing then set this to 100
@RepeatedTest(value = 1)
public void testStackSize() throws Exception {