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 2018/09/19 11:32:02 UTC

[camel] branch camel-2.22.x updated: CAMEL-12542: Fixed seda endpoint documentation about default queue size.

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

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


The following commit(s) were added to refs/heads/camel-2.22.x by this push:
     new 9279ff9  CAMEL-12542: Fixed seda endpoint documentation about default queue size.
9279ff9 is described below

commit 9279ff9a5d310f07a0490ecb9c9f84bcdb6fd652
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Sep 19 13:31:17 2018 +0200

    CAMEL-12542: Fixed seda endpoint documentation about default queue size.
---
 camel-core/src/main/docs/seda-component.adoc                      | 2 +-
 camel-core/src/main/docs/stub-component.adoc                      | 2 +-
 camel-core/src/main/docs/vm-component.adoc                        | 2 +-
 .../main/java/org/apache/camel/component/seda/SedaEndpoint.java   | 8 +++++---
 camel-core/src/main/java/org/apache/camel/util/SedaConstants.java | 1 +
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/camel-core/src/main/docs/seda-component.adoc b/camel-core/src/main/docs/seda-component.adoc
index 2d11d56..d12159c 100644
--- a/camel-core/src/main/docs/seda-component.adoc
+++ b/camel-core/src/main/docs/seda-component.adoc
@@ -81,7 +81,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). | 2147483647 | int
+| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). Will by default use the defaultSize set on the SEDA component. | 1000 | int
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored. | false | boolean
 | *concurrentConsumers* (consumer) | Number of concurrent threads processing exchanges. | 1 | int
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored. |  | ExceptionHandler
diff --git a/camel-core/src/main/docs/stub-component.adoc b/camel-core/src/main/docs/stub-component.adoc
index a0ad265..eb112d3 100644
--- a/camel-core/src/main/docs/stub-component.adoc
+++ b/camel-core/src/main/docs/stub-component.adoc
@@ -71,7 +71,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). | 2147483647 | int
+| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). Will by default use the defaultSize set on the SEDA component. | 1000 | int
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored. | false | boolean
 | *concurrentConsumers* (consumer) | Number of concurrent threads processing exchanges. | 1 | int
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored. |  | ExceptionHandler
diff --git a/camel-core/src/main/docs/vm-component.adoc b/camel-core/src/main/docs/vm-component.adoc
index b892b23..8e1c3a9 100644
--- a/camel-core/src/main/docs/vm-component.adoc
+++ b/camel-core/src/main/docs/vm-component.adoc
@@ -101,7 +101,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). | 2147483647 | int
+| *size* (common) | The maximum capacity of the SEDA queue (i.e., the number of messages it can hold). Will by default use the defaultSize set on the SEDA component. | 1000 | int
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored. | false | boolean
 | *concurrentConsumers* (consumer) | Number of concurrent threads processing exchanges. | 1 | int
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored. |  | ExceptionHandler
diff --git a/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
index faa5fad..6c7ef08 100644
--- a/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java
@@ -43,6 +43,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.util.SedaConstants;
 import org.apache.camel.util.ServiceHelper;
 import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
@@ -65,8 +66,8 @@ public class SedaEndpoint extends DefaultEndpoint implements AsyncEndpoint, Brow
     private String name;
     @UriParam(label = "advanced", description = "Define the queue instance which will be used by the endpoint")
     private BlockingQueue queue;
-    @UriParam(defaultValue = "" + Integer.MAX_VALUE)
-    private int size = Integer.MAX_VALUE;
+    @UriParam(defaultValue = "" + SedaConstants.QUEUE_SIZE)
+    private int size = SedaConstants.QUEUE_SIZE;
 
     @UriParam(label = "consumer", defaultValue = "1")
     private int concurrentConsumers = 1;
@@ -166,7 +167,7 @@ public class SedaEndpoint extends DefaultEndpoint implements AsyncEndpoint, Brow
             // can use the already existing queue referenced from the component
             if (getComponent() != null) {
                 // use null to indicate default size (= use what the existing queue has been configured with)
-                Integer size = getSize() == Integer.MAX_VALUE ? null : getSize();
+                Integer size = (getSize() == Integer.MAX_VALUE || getSize() == SedaConstants.QUEUE_SIZE) ? null : getSize();
                 QueueReference ref = getComponent().getOrCreateQueue(this, size, isMultipleConsumers(), queueFactory);
                 queue = ref.getQueue();
                 String key = getComponent().getQueueKey(getEndpointUri());
@@ -259,6 +260,7 @@ public class SedaEndpoint extends DefaultEndpoint implements AsyncEndpoint, Brow
 
     /**
      * The maximum capacity of the SEDA queue (i.e., the number of messages it can hold).
+     * Will by default use the defaultSize set on the SEDA component.
      */
     public void setSize(int size) {
         this.size = size;
diff --git a/camel-core/src/main/java/org/apache/camel/util/SedaConstants.java b/camel-core/src/main/java/org/apache/camel/util/SedaConstants.java
index b6de163..36cb0c7 100644
--- a/camel-core/src/main/java/org/apache/camel/util/SedaConstants.java
+++ b/camel-core/src/main/java/org/apache/camel/util/SedaConstants.java
@@ -21,6 +21,7 @@ public final class SedaConstants {
     public static final int MAX_CONCURRENT_CONSUMERS = 500;
     public static final int CONCURRENT_CONSUMERS = 1;
     public static final int QUEUE_SIZE = 1000;
+
     private SedaConstants() {
     }