[camel] branch master updated (f0712a3 -> 96f8538)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (f0712a3 -> 96f8538)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from f0712a3  Upgrade Mongo Java driver to version 3.9.0
     new c4a5f6f  CAMEL-12921 - Camel-AWS SQS: Add an option to create a SQS delay queue
     new 3b52637  CAMEL-12921 - Added docs
     new 96f8538  CAMEL-12921 - Regen docs

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel-aws/src/main/docs/aws-sqs-component.adoc | 30 +++++++++++++++++++++-
 .../camel/component/aws/sqs/SqsConfiguration.java  | 14 ++++++++++
 .../camel/component/aws/sqs/SqsEndpoint.java       |  6 +++++
 .../sqs/springboot/SqsComponentConfiguration.java  | 13 ++++++++++
 4 files changed, 62 insertions(+), 1 deletion(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/03: CAMEL-12921 - Camel-AWS SQS: Add an option to create a SQS delay queue

acosentino
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

commit c4a5f6f4d7b4d3fd01dfe644a9927b635b9b8731
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Thu Nov 8 13:42:57 2018 +0100

    CAMEL-12921 - Camel-AWS SQS: Add an option to create a SQS delay queue
---
 components/camel-aws/src/main/docs/aws-sqs-component.adoc  |  3 ++-
 .../apache/camel/component/aws/sqs/SqsConfiguration.java   | 14 ++++++++++++++
 .../org/apache/camel/component/aws/sqs/SqsEndpoint.java    |  6 ++++++
 .../aws/sqs/springboot/SqsComponentConfiguration.java      | 13 +++++++++++++
 4 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/src/main/docs/aws-sqs-component.adoc b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
index b285d8a..1b55eb9 100644
--- a/components/camel-aws/src/main/docs/aws-sqs-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
@@ -68,7 +68,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (47 parameters):
+==== Query Parameters (48 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -94,6 +94,7 @@ with the following path and query parameters:
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
 | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPoll Strategy
+| *delayQueue* (producer) | Define if you want to apply delaySeconds option to the queue or on single messages | false | boolean
 | *delaySeconds* (producer) | Delay sending messages for a number of seconds. |  | Integer
 | *messageDeduplicationId Strategy* (producer) | Only for FIFO queues. Strategy for setting the messageDeduplicationId on the message. Can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message. | useExchangeId | MessageDeduplicationId Strategy
 | *messageGroupIdStrategy* (producer) | Only for FIFO queues. Strategy for setting the messageGroupId on the message. Can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsMessageGroupId will be used. |  | MessageGroupIdStrategy
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
index 9714074..ce66e1b 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
@@ -69,6 +69,9 @@ public class SqsConfiguration implements Cloneable {
     // producer properties
     @UriParam(label = "producer")
     private Integer delaySeconds;
+    // producer properties
+    @UriParam(label = "producer")
+    private boolean delayQueue;
     @UriParam(label = "producer", enums = "useConstant,useExchangeId,usePropertyValue")
     private MessageGroupIdStrategy messageGroupIdStrategy;
     @UriParam(label = "producer", defaultValue = "useExchangeId", enums = "useExchangeId,useContentBasedDeduplication")
@@ -224,6 +227,17 @@ public class SqsConfiguration implements Cloneable {
         this.delaySeconds = delaySeconds;
     }
 
+    public boolean isDelayQueue() {
+        return delayQueue;
+    }
+
+    /**
+     * Define if you want to apply delaySeconds option to the queue or on single messages
+     */
+    public void setDelayQueue(boolean delayQueue) {
+        this.delayQueue = delayQueue;
+    }
+
     public Integer getMaximumMessageSize() {
         return maximumMessageSize;
     }
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
index 1182f12..de21934 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java
@@ -183,6 +183,9 @@ public class SqsEndpoint extends ScheduledPollEndpoint implements HeaderFilterSt
         if (getConfiguration().getReceiveMessageWaitTimeSeconds() != null) {
             request.getAttributes().put(QueueAttributeName.ReceiveMessageWaitTimeSeconds.name(), String.valueOf(getConfiguration().getReceiveMessageWaitTimeSeconds()));
         }
+        if (getConfiguration().getDelaySeconds() != null && getConfiguration().isDelayQueue()) {
+            request.getAttributes().put(QueueAttributeName.DelaySeconds.name(), String.valueOf(getConfiguration().getDelaySeconds()));
+        }
         if (getConfiguration().getRedrivePolicy() != null) {
             request.getAttributes().put(QueueAttributeName.RedrivePolicy.name(), getConfiguration().getRedrivePolicy());
         }
@@ -212,6 +215,9 @@ public class SqsEndpoint extends ScheduledPollEndpoint implements HeaderFilterSt
         if (getConfiguration().getReceiveMessageWaitTimeSeconds() != null) {
             request.getAttributes().put(QueueAttributeName.ReceiveMessageWaitTimeSeconds.name(), String.valueOf(getConfiguration().getReceiveMessageWaitTimeSeconds()));
         }
+        if (getConfiguration().getDelaySeconds() != null && getConfiguration().isDelayQueue()) {
+            request.getAttributes().put(QueueAttributeName.DelaySeconds.name(), String.valueOf(getConfiguration().getDelaySeconds()));
+        }
         if (getConfiguration().getRedrivePolicy() != null) {
             request.getAttributes().put(QueueAttributeName.RedrivePolicy.name(), getConfiguration().getRedrivePolicy());
         }
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
index d06b7bd..c8ae146 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentConfiguration.java
@@ -159,6 +159,11 @@ public class SqsComponentConfiguration
          */
         private Integer delaySeconds;
         /**
+         * Define if you want to apply delaySeconds option to the queue or on
+         * single messages
+         */
+        private Boolean delayQueue = false;
+        /**
          * The maximumMessageSize (in bytes) an SQS message can contain for this
          * queue.
          */
@@ -321,6 +326,14 @@ public class SqsComponentConfiguration
             this.delaySeconds = delaySeconds;
         }
 
+        public Boolean getDelayQueue() {
+            return delayQueue;
+        }
+
+        public void setDelayQueue(Boolean delayQueue) {
+            this.delayQueue = delayQueue;
+        }
+
         public Integer getMaximumMessageSize() {
             return maximumMessageSize;
         }

Reply | Threaded
Open this post in threaded view
|

[camel] 02/03: CAMEL-12921 - Added docs

acosentino
In reply to this post by acosentino
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

commit 3b52637f996009e0240264e8bfb12273717fe2e0
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Thu Nov 8 13:56:32 2018 +0100

    CAMEL-12921 - Added docs
---
 .../camel-aws/src/main/docs/aws-sqs-component.adoc | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/components/camel-aws/src/main/docs/aws-sqs-component.adoc b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
index 1b55eb9..906fe4d 100644
--- a/components/camel-aws/src/main/docs/aws-sqs-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
@@ -247,6 +247,33 @@ from("aws-sqs://MyQueue?amazonSQSClient=#client&delay=5000&maxMessagesPerPoll=5"
 .to("mock:result");
 ---------------------------------------------------------------------------------
 
+#### Creating or updating an SQS Queue
+
+In the SQS Component, when an endpoint is started, a check is executed to obtain information
+about the existence of the queue or not. You're able to customize the creation through the QueueAttributeName
+mapping with the SQSConfiguration option.
+
+[source,java]
+---------------------------------------------------------------------------------
+from("aws-sqs://MyQueue?amazonSQSClient=#client&delay=5000&maxMessagesPerPoll=5")
+.to("mock:result");
+---------------------------------------------------------------------------------
+
+In this example if the MyQueue queue is not already created on AWS, it will be created with default parameters from the
+SQS configuration. If it's already up on AWS, the SQS configuration options will be used to override the existent AWS configuration.
+
+#### DelayQueue VS Delay for Single message
+
+From 2.23.0 the component has a new option: delayQueue. When the option is set to true, the SQS Queue will be a DelayQueue with the
+DelaySeconds option as delay. For more information about DelayQueue you can read the https://docs.aws.amazon.com/en_us/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html[AWS SQS documentation].
+One important information to take into account is the following:
+
+- For standard queues, the per-queue delay setting is not retroactive—changing the setting doesn't affect the delay of messages already in the queue.
+- For FIFO queues, the per-queue delay setting is retroactive—changing the setting affects the delay of messages already in the queue.
+
+as stated in the official documentation. If you want to specify a delay on single messages, you can ignore the delayQueue option, while you can set this option
+to true, if you need to add a fixed delay to all messages enqueued.
+
 ### Dependencies
 
 Maven users will need to add the following dependency to their pom.xml.

Reply | Threaded
Open this post in threaded view
|

[camel] 03/03: CAMEL-12921 - Regen docs

acosentino
In reply to this post by acosentino
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

commit 96f853832eaccd83a7ae00007345ac695ceb1777
Author: Andrea Cosentino <[hidden email]>
AuthorDate: Thu Nov 8 14:02:27 2018 +0100

    CAMEL-12921 - Regen docs
---
 components/camel-aws/src/main/docs/aws-sqs-component.adoc               | 2 +-
 .../main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws/src/main/docs/aws-sqs-component.adoc b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
index 906fe4d..970bb77 100644
--- a/components/camel-aws/src/main/docs/aws-sqs-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-sqs-component.adoc
@@ -94,10 +94,10 @@ with the following path and query parameters:
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
 | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPoll Strategy
-| *delayQueue* (producer) | Define if you want to apply delaySeconds option to the queue or on single messages | false | boolean
 | *delaySeconds* (producer) | Delay sending messages for a number of seconds. |  | Integer
 | *messageDeduplicationId Strategy* (producer) | Only for FIFO queues. Strategy for setting the messageDeduplicationId on the message. Can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message. | useExchangeId | MessageDeduplicationId Strategy
 | *messageGroupIdStrategy* (producer) | Only for FIFO queues. Strategy for setting the messageGroupId on the message. Can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsMessageGroupId will be used. |  | MessageGroupIdStrategy
+| *delayQueue* (advanced) | Define if you want to apply delaySeconds option to the queue or on single messages | false | boolean
 | *queueUrl* (advanced) | To define the queueUrl explicitly. All other parameters, which would influence the queueUrl, are ignored. This parameter is intended to be used, to connect to a mock implementation of SQS, for testing purposes. |  | String
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 | *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. |  | int
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
index ce66e1b..d6ad090 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java
@@ -70,7 +70,7 @@ public class SqsConfiguration implements Cloneable {
     @UriParam(label = "producer")
     private Integer delaySeconds;
     // producer properties
-    @UriParam(label = "producer")
+    @UriParam(label = "advanced")
     private boolean delayQueue;
     @UriParam(label = "producer", enums = "useConstant,useExchangeId,usePropertyValue")
     private MessageGroupIdStrategy messageGroupIdStrategy;