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 e2c4a52 CAMEL-16222: camel-core - ExchangeFactory SPI to allow to use exchange pooling e2c4a52 is described below commit e2c4a52837e96e42179fd534c7e57e3bed7b535a Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Feb 25 08:36:13 2021 +0100 CAMEL-16222: camel-core - ExchangeFactory SPI to allow to use exchange pooling --- .../apache/camel/main/DefaultConfigurationConfigurer.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java index 29fc50f..ad72ea7 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java @@ -31,7 +31,6 @@ import org.apache.camel.cluster.CamelClusterService; import org.apache.camel.health.HealthCheckRegistry; import org.apache.camel.health.HealthCheckRepository; import org.apache.camel.impl.debugger.BacklogTracer; -import org.apache.camel.impl.engine.DefaultExchangeFactory; import org.apache.camel.impl.engine.PooledExchangeFactory; import org.apache.camel.model.Model; import org.apache.camel.model.ModelCamelContext; @@ -125,14 +124,6 @@ public final class DefaultConfigurationConfigurer { if ("pooled".equals(config.getExchangeFactory())) { ecc.setExchangeFactory(new PooledExchangeFactory()); - } else if ("default".equals(config.getExchangeFactory())) { - ecc.setExchangeFactory(new DefaultExchangeFactory()); - } else { - ExchangeFactory ef - = camelContext.getRegistry().lookupByNameAndType(config.getExchangeFactory(), ExchangeFactory.class); - if (ef != null) { - ecc.setExchangeFactory(ef); - } } ecc.getExchangeFactory().setStatisticsEnabled(config.isExchangeFactoryStatisticsEnabled()); ecc.getExchangeFactory().setCapacity(config.getExchangeFactoryCapacity()); @@ -374,6 +365,10 @@ public final class DefaultConfigurationConfigurer { if (ss != null) { ecc.setShutdownStrategy(ss); } + ExchangeFactory exf = getSingleBeanOfType(registry, ExchangeFactory.class); + if (exf != null) { + ecc.setExchangeFactory(exf); + } Set<TypeConverters> tcs = registry.findByType(TypeConverters.class); if (!tcs.isEmpty()) { tcs.forEach(t -> camelContext.getTypeConverterRegistry().addTypeConverters(t));