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

acosentino 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 ef11109  CAMEL-12584:Allow seda producers to offer data to the queue 
with timeout
ef11109 is described below

commit ef111092ccf8451e06e318ceae7e2f386eda9feb
Author: Ramu <[email protected]>
AuthorDate: Mon Jun 25 17:51:42 2018 +0530

    CAMEL-12584:Allow seda producers to offer data to the queue with timeout
---
 camel-core/src/main/docs/seda-component.adoc       |  6 ++++--
 camel-core/src/main/docs/stub-component.adoc       |  6 ++++--
 camel-core/src/main/docs/vm-component.adoc         |  6 ++++--
 .../apache/camel/component/seda/SedaComponent.java | 21 ++++++++++++++++++-
 .../apache/camel/component/seda/SedaEndpoint.java  | 17 ++++++++++++++-
 .../apache/camel/component/seda/SedaProducer.java  | 24 +++++++++++++++++-----
 .../component/seda/SedaBlockWhenFullTest.java      | 20 ++++++++++++++++--
 .../springboot/SedaComponentConfiguration.java     | 16 +++++++++++++++
 .../springboot/StubComponentConfiguration.java     | 16 +++++++++++++++
 .../vm/springboot/VmComponentConfiguration.java    | 16 +++++++++++++++
 10 files changed, 133 insertions(+), 15 deletions(-)

diff --git a/camel-core/src/main/docs/seda-component.adoc 
b/camel-core/src/main/docs/seda-component.adoc
index c3faf73..2d11d56 100644
--- a/camel-core/src/main/docs/seda-component.adoc
+++ b/camel-core/src/main/docs/seda-component.adoc
@@ -39,7 +39,7 @@ You can append query options to the URI in the following 
format:
 === Options
 
 // component options: START
-The SEDA component supports 5 options, which are listed below.
+The SEDA component supports 6 options, which are listed below.
 
 
 
@@ -50,6 +50,7 @@ The SEDA component supports 5 options, which are listed below.
 | *concurrentConsumers* (consumer) | Sets the default number of concurrent 
threads processing exchanges. | 1 | int
 | *defaultQueueFactory* (advanced) | Sets the default queue factory. |  | 
Exchange>
 | *defaultBlockWhenFull* (producer) | Whether a thread that sends messages to 
a full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
+| *defaultOfferTimeout* (producer) | Whether a thread that sends messages to a 
full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, where a configured timeout can be added to the block 
case. Utilizing the .offer(timeout) method of the underlining java queue |  | 
long
 | *resolveProperty Placeholders* (advanced) | Whether the component should 
resolve property placeholders on itself when starting. Only properties which 
are of String type can use property placeholders. | true | boolean
 |===
 // component options: END
@@ -74,7 +75,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (16 parameters):
+==== Query Parameters (17 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -92,6 +93,7 @@ with the following path and query parameters:
 | *blockWhenFull* (producer) | Whether a thread that sends messages to a full 
SEDA queue will block until the queue's capacity is no longer exhausted. By 
default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
 | *discardIfNoConsumers* (producer) | Whether the producer should discard the 
message (do not add the message to the queue), when sending to a queue with no 
active consumers. Only one of the options discardIfNoConsumers and 
failIfNoConsumers can be enabled at the same time. | false | boolean
 | *failIfNoConsumers* (producer) | Whether the producer should fail by 
throwing an exception, when sending to a queue with no active consumers. Only 
one of the options discardIfNoConsumers and failIfNoConsumers can be enabled at 
the same time. | false | boolean
+| *offerTimeout* (producer) | offerTimeout (in milliseconds) can be added to 
the block case when queue is full. You can disable timeout by using 0 or a 
negative value. |  | long
 | *timeout* (producer) | Timeout (in milliseconds) before a SEDA producer will 
stop waiting for an asynchronous task to complete. You can disable timeout by 
using 0 or a negative value. | 30000 | long
 | *waitForTaskToComplete* (producer) | Option to specify whether the caller 
should wait for the async task to complete or not before continuing. The 
following three options are supported: Always, Never or IfReplyExpected. The 
first two values are self-explanatory. The last value, IfReplyExpected, will 
only wait if the message is Request Reply based. The default option is 
IfReplyExpected. | IfReplyExpected | WaitForTaskToComplete
 | *queue* (advanced) | Define the queue instance which will be used by the 
endpoint. This option is only for rare use-cases where you want to use a custom 
queue instance. |  | BlockingQueue
diff --git a/camel-core/src/main/docs/stub-component.adoc 
b/camel-core/src/main/docs/stub-component.adoc
index 8ba4456..a0ad265 100644
--- a/camel-core/src/main/docs/stub-component.adoc
+++ b/camel-core/src/main/docs/stub-component.adoc
@@ -29,7 +29,7 @@ Where *`someUri`* can be any URI with any query parameters.
 === Options
 
 // component options: START
-The Stub component supports 5 options, which are listed below.
+The Stub component supports 6 options, which are listed below.
 
 
 
@@ -40,6 +40,7 @@ The Stub component supports 5 options, which are listed below.
 | *concurrentConsumers* (consumer) | Sets the default number of concurrent 
threads processing exchanges. | 1 | int
 | *defaultQueueFactory* (advanced) | Sets the default queue factory. |  | 
Exchange>
 | *defaultBlockWhenFull* (producer) | Whether a thread that sends messages to 
a full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
+| *defaultOfferTimeout* (producer) | Whether a thread that sends messages to a 
full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, where a configured timeout can be added to the block 
case. Utilizing the .offer(timeout) method of the underlining java queue |  | 
long
 | *resolveProperty Placeholders* (advanced) | Whether the component should 
resolve property placeholders on itself when starting. Only properties which 
are of String type can use property placeholders. | true | boolean
 |===
 // component options: END
@@ -64,7 +65,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (16 parameters):
+==== Query Parameters (17 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -82,6 +83,7 @@ with the following path and query parameters:
 | *blockWhenFull* (producer) | Whether a thread that sends messages to a full 
SEDA queue will block until the queue's capacity is no longer exhausted. By 
default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
 | *discardIfNoConsumers* (producer) | Whether the producer should discard the 
message (do not add the message to the queue), when sending to a queue with no 
active consumers. Only one of the options discardIfNoConsumers and 
failIfNoConsumers can be enabled at the same time. | false | boolean
 | *failIfNoConsumers* (producer) | Whether the producer should fail by 
throwing an exception, when sending to a queue with no active consumers. Only 
one of the options discardIfNoConsumers and failIfNoConsumers can be enabled at 
the same time. | false | boolean
+| *offerTimeout* (producer) | offerTimeout (in milliseconds) can be added to 
the block case when queue is full. You can disable timeout by using 0 or a 
negative value. |  | long
 | *timeout* (producer) | Timeout (in milliseconds) before a SEDA producer will 
stop waiting for an asynchronous task to complete. You can disable timeout by 
using 0 or a negative value. | 30000 | long
 | *waitForTaskToComplete* (producer) | Option to specify whether the caller 
should wait for the async task to complete or not before continuing. The 
following three options are supported: Always, Never or IfReplyExpected. The 
first two values are self-explanatory. The last value, IfReplyExpected, will 
only wait if the message is Request Reply based. The default option is 
IfReplyExpected. | IfReplyExpected | WaitForTaskToComplete
 | *queue* (advanced) | Define the queue instance which will be used by the 
endpoint. This option is only for rare use-cases where you want to use a custom 
queue instance. |  | BlockingQueue
diff --git a/camel-core/src/main/docs/vm-component.adoc 
b/camel-core/src/main/docs/vm-component.adoc
index 77041db..b892b23 100644
--- a/camel-core/src/main/docs/vm-component.adoc
+++ b/camel-core/src/main/docs/vm-component.adoc
@@ -59,7 +59,7 @@ from("vm:bar?concurrentConsumers=5").to("file://output");
 === Options
 
 // component options: START
-The VM component supports 5 options, which are listed below.
+The VM component supports 6 options, which are listed below.
 
 
 
@@ -70,6 +70,7 @@ The VM component supports 5 options, which are listed below.
 | *concurrentConsumers* (consumer) | Sets the default number of concurrent 
threads processing exchanges. | 1 | int
 | *defaultQueueFactory* (advanced) | Sets the default queue factory. |  | 
Exchange>
 | *defaultBlockWhenFull* (producer) | Whether a thread that sends messages to 
a full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
+| *defaultOfferTimeout* (producer) | Whether a thread that sends messages to a 
full SEDA queue will block until the queue's capacity is no longer exhausted. 
By default, an exception will be thrown stating that the queue is full. By 
enabling this option, where a configured timeout can be added to the block 
case. Utilizing the .offer(timeout) method of the underlining java queue |  | 
long
 | *resolveProperty Placeholders* (advanced) | Whether the component should 
resolve property placeholders on itself when starting. Only properties which 
are of String type can use property placeholders. | true | boolean
 |===
 // component options: END
@@ -94,7 +95,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (16 parameters):
+==== Query Parameters (17 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -112,6 +113,7 @@ with the following path and query parameters:
 | *blockWhenFull* (producer) | Whether a thread that sends messages to a full 
SEDA queue will block until the queue's capacity is no longer exhausted. By 
default, an exception will be thrown stating that the queue is full. By 
enabling this option, the calling thread will instead block and wait until the 
message can be accepted. | false | boolean
 | *discardIfNoConsumers* (producer) | Whether the producer should discard the 
message (do not add the message to the queue), when sending to a queue with no 
active consumers. Only one of the options discardIfNoConsumers and 
failIfNoConsumers can be enabled at the same time. | false | boolean
 | *failIfNoConsumers* (producer) | Whether the producer should fail by 
throwing an exception, when sending to a queue with no active consumers. Only 
one of the options discardIfNoConsumers and failIfNoConsumers can be enabled at 
the same time. | false | boolean
+| *offerTimeout* (producer) | offerTimeout (in milliseconds) can be added to 
the block case when queue is full. You can disable timeout by using 0 or a 
negative value. |  | long
 | *timeout* (producer) | Timeout (in milliseconds) before a SEDA producer will 
stop waiting for an asynchronous task to complete. You can disable timeout by 
using 0 or a negative value. | 30000 | long
 | *waitForTaskToComplete* (producer) | Option to specify whether the caller 
should wait for the async task to complete or not before continuing. The 
following three options are supported: Always, Never or IfReplyExpected. The 
first two values are self-explanatory. The last value, IfReplyExpected, will 
only wait if the message is Request Reply based. The default option is 
IfReplyExpected. | IfReplyExpected | WaitForTaskToComplete
 | *queue* (advanced) | Define the queue instance which will be used by the 
endpoint. This option is only for rare use-cases where you want to use a custom 
queue instance. |  | BlockingQueue
diff --git 
a/camel-core/src/main/java/org/apache/camel/component/seda/SedaComponent.java 
b/camel-core/src/main/java/org/apache/camel/component/seda/SedaComponent.java
index f41a46a..2ed80a2 100644
--- 
a/camel-core/src/main/java/org/apache/camel/component/seda/SedaComponent.java
+++ 
b/camel-core/src/main/java/org/apache/camel/component/seda/SedaComponent.java
@@ -46,6 +46,8 @@ public class SedaComponent extends UriEndpointComponent {
     protected BlockingQueueFactory<Exchange> defaultQueueFactory = new 
LinkedBlockingQueueFactory<>();
     @Metadata(label = "producer")
     private boolean defaultBlockWhenFull;
+    @Metadata(label = "producer")
+    private long defaultOfferTimeout;
 
     private final Map<String, QueueReference> queues = new HashMap<>();
 
@@ -102,6 +104,20 @@ public class SedaComponent extends UriEndpointComponent {
     public void setDefaultBlockWhenFull(boolean defaultBlockWhenFull) {
         this.defaultBlockWhenFull = defaultBlockWhenFull;
     }
+    
+    
+    public long getDefaultOfferTimeout() {
+        return defaultOfferTimeout;
+    }
+    
+    /**
+     * Whether a thread that sends messages to a full SEDA queue will block 
until the queue's capacity is no longer exhausted.
+     * By default, an exception will be thrown stating that the queue is full.
+     * By enabling this option, where a configured timeout can be added to the 
block case.  Utilizing the .offer(timeout) method of the underlining java queue
+     */
+    public void setDefaultOfferTimeout(long defaultOfferTimeout) {
+        this.defaultOfferTimeout = defaultOfferTimeout;
+    }
 
     /**
      * @deprecated use
@@ -208,7 +224,10 @@ public class SedaComponent extends UriEndpointComponent {
 
         // if blockWhenFull is set on endpoint, defaultBlockWhenFull is 
ignored.
         boolean blockWhenFull = getAndRemoveParameter(parameters, 
"blockWhenFull", boolean.class, defaultBlockWhenFull);
-
+        // if offerTimeout is set on endpoint, defaultOfferTimeout is ignored.
+        long offerTimeout = getAndRemoveParameter(parameters, "offerTimeout", 
long.class, defaultOfferTimeout);
+        
+        answer.setOfferTimeout(offerTimeout);
         answer.setBlockWhenFull(blockWhenFull);
         answer.configureProperties(parameters);
         answer.setConcurrentConsumers(consumers);
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 45df699..faa5fad 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
@@ -84,6 +84,8 @@ public class SedaEndpoint extends DefaultEndpoint implements 
AsyncEndpoint, Brow
     @UriParam(label = "producer", defaultValue = "30000")
     private long timeout = 30000;
     @UriParam(label = "producer")
+    private long offerTimeout;
+    @UriParam(label = "producer")
     private boolean blockWhenFull;
     @UriParam(label = "producer")
     private boolean failIfNoConsumers;
@@ -126,7 +128,7 @@ public class SedaEndpoint extends DefaultEndpoint 
implements AsyncEndpoint, Brow
     }
 
     public Producer createProducer() throws Exception {
-        return new SedaProducer(this, getWaitForTaskToComplete(), 
getTimeout(), isBlockWhenFull());
+        return new SedaProducer(this, getWaitForTaskToComplete(), 
getTimeout(), isBlockWhenFull(), getOfferTimeout());
     }
 
     public Consumer createConsumer(Processor processor) throws Exception {
@@ -333,6 +335,19 @@ public class SedaEndpoint extends DefaultEndpoint 
implements AsyncEndpoint, Brow
     public void setTimeout(long timeout) {
         this.timeout = timeout;
     }
+    
+    @ManagedAttribute
+    public long getOfferTimeout() {
+        return offerTimeout;
+    }
+    
+    /**
+     * offerTimeout (in milliseconds)  can be added to the block case when 
queue is full.
+     * You can disable timeout by using 0 or a negative value.
+     */
+    public void setOfferTimeout(long offerTimeout) {
+        this.offerTimeout = offerTimeout;
+    }
 
     @ManagedAttribute
     public boolean isFailIfNoConsumers() {
diff --git 
a/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java 
b/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java
index 5da92d6..aa44b75 100644
--- a/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java
@@ -41,30 +41,32 @@ public class SedaProducer extends DefaultAsyncProducer {
     private final WaitForTaskToComplete waitForTaskToComplete;
     private final long timeout;
     private final boolean blockWhenFull;
+    private final long offerTimeout;
 
     /**
      * @deprecated Use {@link #SedaProducer(SedaEndpoint, 
WaitForTaskToComplete, long, boolean) the other constructor}.
      */
     @Deprecated
     public SedaProducer(SedaEndpoint endpoint, BlockingQueue<Exchange> queue, 
WaitForTaskToComplete waitForTaskToComplete, long timeout) {
-        this(endpoint, waitForTaskToComplete, timeout, false);
+        this(endpoint, waitForTaskToComplete, timeout, false, 0);
     }
 
     /**
      * @deprecated Use {@link #SedaProducer(SedaEndpoint, 
WaitForTaskToComplete, long, boolean) the other constructor}.
      */
     @Deprecated
-    public SedaProducer(SedaEndpoint endpoint, BlockingQueue<Exchange> queue, 
WaitForTaskToComplete waitForTaskToComplete, long timeout, boolean 
blockWhenFull) {
-        this(endpoint, waitForTaskToComplete, timeout, blockWhenFull);
+    public SedaProducer(SedaEndpoint endpoint, BlockingQueue<Exchange> queue, 
WaitForTaskToComplete waitForTaskToComplete, long timeout, boolean 
blockWhenFull, long offerTimeout) {
+        this(endpoint, waitForTaskToComplete, timeout, blockWhenFull, 
offerTimeout);
     }
 
-    public SedaProducer(SedaEndpoint endpoint, WaitForTaskToComplete 
waitForTaskToComplete, long timeout, boolean blockWhenFull) {
+    public SedaProducer(SedaEndpoint endpoint, WaitForTaskToComplete 
waitForTaskToComplete, long timeout, boolean blockWhenFull, long offerTimeout) {
         super(endpoint);
         this.queue = endpoint.getQueue();
         this.endpoint = endpoint;
         this.waitForTaskToComplete = waitForTaskToComplete;
         this.timeout = timeout;
         this.blockWhenFull = blockWhenFull;
+        this.offerTimeout = offerTimeout;
     }
 
     @Override
@@ -209,6 +211,7 @@ public class SedaProducer extends DefaultAsyncProducer {
      * @param copy     whether to create a copy of the exchange to use for 
adding to the queue
      */
     protected void addToQueue(Exchange exchange, boolean copy) throws 
SedaConsumerNotAvailableException {
+        boolean offerTime;
         BlockingQueue<Exchange> queue = null;
         QueueReference queueReference = endpoint.getQueueReference();
         if (queueReference != null) {
@@ -236,13 +239,24 @@ public class SedaProducer extends DefaultAsyncProducer {
         }
 
         log.trace("Adding Exchange to queue: {}", target);
-        if (blockWhenFull) {
+        if (blockWhenFull && offerTimeout == 0) {
             try {
                 queue.put(target);
             } catch (InterruptedException e) {
                 // ignore
                 log.debug("Put interrupted, are we stopping? {}", isStopping() 
|| isStopped());
             }
+        } else if (blockWhenFull && offerTimeout > 0) {
+            try {
+                offerTime = queue.offer(target, offerTimeout, 
TimeUnit.MILLISECONDS);
+                if (!offerTime) {
+                    throw new IllegalStateException("Fails to insert element 
into queue, "
+                            + "after timeout of"  + offerTimeout + 
"milliseconds");
+                }
+            } catch (InterruptedException e) {
+                // ignore
+                log.debug("Offer interrupted, are we stopping? {}", 
isStopping() || isStopped());
+            }
         } else {
             queue.add(target);
         }
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java
index 29eae02..949b2cc 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/seda/SedaBlockWhenFullTest.java
@@ -30,7 +30,8 @@ public class SedaBlockWhenFullTest extends ContextTestSupport 
{
     private static final int DELAY_LONG = 100;
     private static final String MOCK_URI = "mock:blockWhenFullOutput";
     private static final String SIZE_PARAM = "?size=%d";
-    private static final String BLOCK_WHEN_FULL_URI = "seda:blockingFoo" + 
String.format(SIZE_PARAM, QUEUE_SIZE) + "&blockWhenFull=true&timeout=0";
+    private static final String SEDA_WITH_OFFER_TIMEOUT_URI = 
"seda:blockingFoo" + String.format(SIZE_PARAM, QUEUE_SIZE) + 
"&blockWhenFull=true&offerTimeout=100";
+    private static final String BLOCK_WHEN_FULL_URI = "seda:blockingFoo" + 
String.format(SIZE_PARAM, QUEUE_SIZE) + 
"&blockWhenFull=true&timeout=0&offerTimeout=200";
     private static final String DEFAULT_URI = "seda:foo" + 
String.format(SIZE_PARAM, QUEUE_SIZE);
 
     @Override
@@ -45,6 +46,22 @@ public class SedaBlockWhenFullTest extends 
ContextTestSupport {
             }
         };
     }
+    
+    
+   
+    public void testSedaOfferTimeoutWhenFull() throws Exception {
+        try {
+            SedaEndpoint seda = 
context.getEndpoint(SEDA_WITH_OFFER_TIMEOUT_URI, SedaEndpoint.class);
+            assertEquals(QUEUE_SIZE, seda.getQueue().remainingCapacity());
+
+            sendTwoOverCapacity(SEDA_WITH_OFFER_TIMEOUT_URI, QUEUE_SIZE);
+
+            fail("Fails to insert element into queue, "
+                    + "after timeout of"  + seda.getOfferTimeout() + 
"milliseconds");
+        } catch (Exception e) {
+            assertIsInstanceOf(IllegalStateException.class, e.getCause());
+        }
+    }
 
     public void testSedaDefaultWhenFull() throws Exception {
         try {
@@ -61,7 +78,6 @@ public class SedaBlockWhenFullTest extends ContextTestSupport 
{
 
     public void testSedaBlockingWhenFull() throws Exception {
         getMockEndpoint(MOCK_URI).setExpectedMessageCount(QUEUE_SIZE + 2);
-        
         SedaEndpoint seda = context.getEndpoint(BLOCK_WHEN_FULL_URI, 
SedaEndpoint.class);
         assertEquals(QUEUE_SIZE, seda.getQueue().remainingCapacity());
 
diff --git 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java
 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java
index f45a518..3d7b468 100644
--- 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java
+++ 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/seda/springboot/SedaComponentConfiguration.java
@@ -58,6 +58,14 @@ public class SedaComponentConfiguration
      */
     private Boolean defaultBlockWhenFull = false;
     /**
+     * Whether a thread that sends messages to a full SEDA queue will block
+     * until the queue's capacity is no longer exhausted. By default, an
+     * exception will be thrown stating that the queue is full. By enabling 
this
+     * option, where a configured timeout can be added to the block case.
+     * Utilizing the .offer(timeout) method of the underlining java queue
+     */
+    private Long defaultOfferTimeout;
+    /**
      * Whether the component should resolve property placeholders on itself 
when
      * starting. Only properties which are of String type can use property
      * placeholders.
@@ -97,6 +105,14 @@ public class SedaComponentConfiguration
         this.defaultBlockWhenFull = defaultBlockWhenFull;
     }
 
+    public Long getDefaultOfferTimeout() {
+        return defaultOfferTimeout;
+    }
+
+    public void setDefaultOfferTimeout(Long defaultOfferTimeout) {
+        this.defaultOfferTimeout = defaultOfferTimeout;
+    }
+
     public Boolean getResolvePropertyPlaceholders() {
         return resolvePropertyPlaceholders;
     }
diff --git 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java
 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java
index 82b5a30..d01d438 100644
--- 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java
+++ 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/stub/springboot/StubComponentConfiguration.java
@@ -58,6 +58,14 @@ public class StubComponentConfiguration
      */
     private Boolean defaultBlockWhenFull = false;
     /**
+     * Whether a thread that sends messages to a full SEDA queue will block
+     * until the queue's capacity is no longer exhausted. By default, an
+     * exception will be thrown stating that the queue is full. By enabling 
this
+     * option, where a configured timeout can be added to the block case.
+     * Utilizing the .offer(timeout) method of the underlining java queue
+     */
+    private Long defaultOfferTimeout;
+    /**
      * Whether the component should resolve property placeholders on itself 
when
      * starting. Only properties which are of String type can use property
      * placeholders.
@@ -97,6 +105,14 @@ public class StubComponentConfiguration
         this.defaultBlockWhenFull = defaultBlockWhenFull;
     }
 
+    public Long getDefaultOfferTimeout() {
+        return defaultOfferTimeout;
+    }
+
+    public void setDefaultOfferTimeout(Long defaultOfferTimeout) {
+        this.defaultOfferTimeout = defaultOfferTimeout;
+    }
+
     public Boolean getResolvePropertyPlaceholders() {
         return resolvePropertyPlaceholders;
     }
diff --git 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java
 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java
index 17f5b4c..7af9617 100644
--- 
a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java
+++ 
b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/vm/springboot/VmComponentConfiguration.java
@@ -58,6 +58,14 @@ public class VmComponentConfiguration
      */
     private Boolean defaultBlockWhenFull = false;
     /**
+     * Whether a thread that sends messages to a full SEDA queue will block
+     * until the queue's capacity is no longer exhausted. By default, an
+     * exception will be thrown stating that the queue is full. By enabling 
this
+     * option, where a configured timeout can be added to the block case.
+     * Utilizing the .offer(timeout) method of the underlining java queue
+     */
+    private Long defaultOfferTimeout;
+    /**
      * Whether the component should resolve property placeholders on itself 
when
      * starting. Only properties which are of String type can use property
      * placeholders.
@@ -97,6 +105,14 @@ public class VmComponentConfiguration
         this.defaultBlockWhenFull = defaultBlockWhenFull;
     }
 
+    public Long getDefaultOfferTimeout() {
+        return defaultOfferTimeout;
+    }
+
+    public void setDefaultOfferTimeout(Long defaultOfferTimeout) {
+        this.defaultOfferTimeout = defaultOfferTimeout;
+    }
+
     public Boolean getResolvePropertyPlaceholders() {
         return resolvePropertyPlaceholders;
     }

Reply via email to