camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] 03/07: CAMEL-12124: Allow to configure cacheSize on dynamic router and routing slip EIP annotations
Date Thu, 04 Jan 2018 18:52:13 GMT
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

commit a92a2112181a7fcfa82c1445e4fc13e067bafc49
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Thu Jan 4 15:40:08 2018 +0100

    CAMEL-12124: Allow to configure cacheSize on dynamic router and routing slip EIP annotations
---
 camel-core/src/main/java/org/apache/camel/DynamicRouter.java       | 6 ++++++
 camel-core/src/main/java/org/apache/camel/RoutingSlip.java         | 7 +++++++
 .../src/main/java/org/apache/camel/component/bean/MethodInfo.java  | 3 +++
 .../main/java/org/apache/camel/model/DynamicRouterDefinition.java  | 2 +-
 .../main/java/org/apache/camel/model/RoutingSlipDefinition.java    | 2 +-
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/DynamicRouter.java b/camel-core/src/main/java/org/apache/camel/DynamicRouter.java
index d6105cd..3b0d357 100644
--- a/camel-core/src/main/java/org/apache/camel/DynamicRouter.java
+++ b/camel-core/src/main/java/org/apache/camel/DynamicRouter.java
@@ -59,4 +59,10 @@ public @interface DynamicRouter {
      * Whether to ignore the invalidate endpoint exception when try to create a producer
with that endpoint
      */
     boolean ignoreInvalidEndpoints() default false;
+
+    /**
+     * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which
is used
+     * to cache and reuse producers when using this dynamic router, when uris are reused.
+     */
+    int cacheSize() default 0;
 }
diff --git a/camel-core/src/main/java/org/apache/camel/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/RoutingSlip.java
index d7e95f1..e93901c 100644
--- a/camel-core/src/main/java/org/apache/camel/RoutingSlip.java
+++ b/camel-core/src/main/java/org/apache/camel/RoutingSlip.java
@@ -59,4 +59,11 @@ public @interface RoutingSlip {
      * Whether to ignore the invalidate endpoint exception when try to create a producer
with that endpoint
      */
     boolean ignoreInvalidEndpoints() default false;
+
+    /**
+     * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which
is used
+     * to cache and reuse producers when using this routing slip, when uris are reused.
+     */
+    int cacheSize() default 0;
+
 }
diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
index d9a836a..766ee2c 100644
--- a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
+++ b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
@@ -134,6 +134,8 @@ public class MethodInfo {
             routingSlip = new RoutingSlip(camelContext);
             routingSlip.setDelimiter(routingSlipAnnotation.delimiter());
             routingSlip.setIgnoreInvalidEndpoints(routingSlipAnnotation.ignoreInvalidEndpoints());
+            routingSlip.setCacheSize(routingSlipAnnotation.cacheSize());
+
             // add created routingSlip as a service so we have its lifecycle managed
             try {
                 camelContext.addService(routingSlip);
@@ -149,6 +151,7 @@ public class MethodInfo {
             dynamicRouter = new DynamicRouter(camelContext);
             dynamicRouter.setDelimiter(dynamicRouterAnnotation.delimiter());
             dynamicRouter.setIgnoreInvalidEndpoints(dynamicRouterAnnotation.ignoreInvalidEndpoints());
+            dynamicRouter.setCacheSize(dynamicRouterAnnotation.cacheSize());
             // add created dynamicRouter as a service so we have its lifecycle managed
             try {
                 camelContext.addService(dynamicRouter);
diff --git a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
index 505fb01..e4b855d 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DynamicRouterDefinition.java
@@ -174,7 +174,7 @@ public class DynamicRouterDefinition<Type extends ProcessorDefinition<Type>>
ext
     
     /**
      * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which
is used
-     * to cache and reuse producers when using this recipient list, when uris are reused.
+     * to cache and reuse producers when using this dynamic router, when uris are reused.
      *
      * @param cacheSize  the cache size, use <tt>0</tt> for default cache size,
or <tt>-1</tt> to turn cache off.
      * @return the builder
diff --git a/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java b/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
index 8815640..413d8d5 100644
--- a/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/RoutingSlipDefinition.java
@@ -187,7 +187,7 @@ public class RoutingSlipDefinition<Type extends ProcessorDefinition<Type>>
exten
 
     /**
      * Sets the maximum size used by the {@link org.apache.camel.impl.ProducerCache} which
is used
-     * to cache and reuse producers when using this recipient list, when uris are reused.
+     * to cache and reuse producers when using this routing slip, when uris are reused.
      *
      * @param cacheSize  the cache size, use <tt>0</tt> for default cache size,
or <tt>-1</tt> to turn cache off.
      * @return the builder

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <commits@camel.apache.org>.

Mime
View raw message