This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch exchange-factory
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b54a41bab408eb88570c2a5ddd6bc3ab9e8a2786
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Feb 24 07:28:15 2021 +0100

    CAMEL-16222: PooledExchangeFactory experiment
---
 .../camel/impl/engine/PooledExchangeFactory.java   |  2 --
 .../camel/main/DefaultConfigurationProperties.java | 30 ++++++++++++++--------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
index 45237e9..6bfe639 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/PooledExchangeFactory.java
@@ -24,7 +24,6 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Consumer;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
-import org.apache.camel.Experimental;
 import org.apache.camel.NonManagedService;
 import org.apache.camel.PooledExchange;
 import org.apache.camel.StaticService;
@@ -38,7 +37,6 @@ import org.slf4j.LoggerFactory;
 /**
  * Pooled {@link ExchangeFactory} that reuses {@link Exchange} instance from a 
pool.
  */
-@Experimental
 public final class PooledExchangeFactory extends ServiceSupport
         implements ExchangeFactory, CamelContextAware, StaticService, 
NonManagedService {
 
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index ef780a2..a62096a 100644
--- 
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++ 
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.main;
 
-import org.apache.camel.Experimental;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.ManagementStatisticsLevel;
 import org.apache.camel.StartupSummaryLevel;
@@ -915,37 +914,32 @@ public abstract class DefaultConfigurationProperties<T> {
         this.routesExcludePattern = routesExcludePattern;
     }
 
-    @Experimental
     public boolean isLightweight() {
         return lightweight;
     }
 
     /**
-     * Experimental: Configure the context to be lightweight. This will 
trigger some optimizations and memory reduction
+     * Configure the context to be lightweight. This will trigger some 
optimizations and memory reduction
      * options. Lightweight context have some limitations. At this moment, 
dynamic endpoint destinations are not
      * supported.
      */
-    @Experimental
     public void setLightweight(boolean lightweight) {
         this.lightweight = lightweight;
     }
 
-    @Experimental
     public String getExchangeFactory() {
         return exchangeFactory;
     }
 
     /**
-     * Experimental: Controls whether to pool (reuse) exchanges or create new 
fresh exchanges (default). Using pooled
+     * Controls whether to pool (reuse) exchanges or create new fresh 
exchanges (default). Using pooled
      * will reduce JVM garbage collection overhead by avoiding to re-create 
Exchange instances per message each consumer
      * receives.
      */
-    @Experimental
     public void setExchangeFactory(String exchangeFactory) {
         this.exchangeFactory = exchangeFactory;
     }
 
-    @Experimental
     public boolean isExchangeFactoryStatisticsEnabled() {
         return exchangeFactoryStatisticsEnabled;
     }
@@ -953,7 +947,6 @@ public abstract class DefaultConfigurationProperties<T> {
     /**
      * Configures whether statistics is enabled on exchange factory.
      */
-    @Experimental
     public void setExchangeFactoryStatisticsEnabled(boolean 
exchangeFactoryStatisticsEnabled) {
         this.exchangeFactoryStatisticsEnabled = 
exchangeFactoryStatisticsEnabled;
     }
@@ -1808,13 +1801,30 @@ public abstract class DefaultConfigurationProperties<T> 
{
      * this should only be done on a JVM with a single Camel application 
(microservice like camel-main, camel-quarkus,
      * camel-spring-boot). As this affects the entire JVM where Camel JARs are 
on the classpath.
      */
-    @Experimental
     public T withLightweight(boolean lightweight) {
         this.lightweight = lightweight;
         return (T) this;
     }
 
     /**
+     * Controls whether to pool (reuse) exchanges or create new fresh 
exchanges (default). Using pooled
+     * will reduce JVM garbage collection overhead by avoiding to re-create 
Exchange instances per message each consumer
+     * receives.
+     */
+    public T withExchangeFactory(String exchangeFactory) {
+        this.exchangeFactory = exchangeFactory;
+        return (T) this;
+    }
+
+    /**
+     * Configures whether statistics is enabled on exchange factory.
+     */
+    public T withExchangeFactoryStatisticsEnabled(boolean 
exchangeFactoryStatisticsEnabled) {
+        this.exchangeFactoryStatisticsEnabled = 
exchangeFactoryStatisticsEnabled;
+        return (T) this;
+    }
+
+    /**
      * Sets the logging level used for logging route activity (such as 
starting and stopping routes). The default
      * logging level is DEBUG.
      */

Reply via email to