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 2021/03/16 09:04:54 UTC
[camel] branch master updated: CAMEL-16355: camel-core - Optimize
Filter and Choice EIP. Change aws2-sqs consumer to use its own property.
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
The following commit(s) were added to refs/heads/master by this push:
new 5af9a3f CAMEL-16355: camel-core - Optimize Filter and Choice EIP. Change aws2-sqs consumer to use its own property.
5af9a3f is described below
commit 5af9a3f36b25a0300234f799864ebfb9cefd1ecc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Mar 16 10:04:13 2021 +0100
CAMEL-16355: camel-core - Optimize Filter and Choice EIP. Change aws2-sqs consumer to use its own property.
---
.../apache/camel/catalog/docs/aws2-sqs-component.adoc | 10 +++++++---
.../org/apache/camel/component/aws2/sqs/aws2-sqs.json | 4 ++--
.../camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc | 10 +++++++---
.../camel/component/aws2/sqs/Sqs2Configuration.java | 6 ++----
.../apache/camel/component/aws2/sqs/Sqs2Constants.java | 1 +
.../apache/camel/component/aws2/sqs/Sqs2Consumer.java | 4 ++--
.../component/dsl/Aws2SqsComponentBuilderFactory.java | 8 +++-----
.../builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java | 16 ++++++----------
.../modules/ROOT/pages/aws2-sqs-component.adoc | 10 +++++++---
.../modules/ROOT/pages/camel-3x-upgrade-guide-3_9.adoc | 6 ++++++
10 files changed, 43 insertions(+), 32 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
index 4e5675c..e492ada 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sqs-component.adoc
@@ -67,7 +67,7 @@ The AWS 2 Simple Queue Service (SQS) component supports 43 options, which are li
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -145,7 +145,7 @@ with the following path and query parameters:
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -321,7 +321,8 @@ of the route, use a Filter:
------------------------------------------------------------------------------------------------------
from("aws2-sqs://MyQueue?amazonSQSClient=#client&defaultVisibilityTimeout=5000&deleteIfFiltered=false&deleteAfterRead=false")
.filter("${header.login} == true")
-.to("mock:result");
+ .setProperty(Sqs2Constants.SQS_DELETE_FILTERED, constant(true))
+ .to("mock:filter");
------------------------------------------------------------------------------------------------------
In the above code, if an exchange doesn't have an appropriate header, it
@@ -329,6 +330,9 @@ will not make it through the filter AND also not be deleted from the SQS
queue. After 5000 milliseconds, the message will become visible to other
consumers.
+Note we must set the property `Sqs2Constants.SQS_DELETE_FILTERED` to `true` to
+instruct Camel to send the DeleteMessage, if being filtered.
+
== Available Producer Operations
- single message (default)
- sendBatchMessage
diff --git a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
index e4e37be..ee5b83e 100644
--- a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
+++ b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
@@ -39,7 +39,7 @@
"concurrentConsumers": { "kind": "property", "displayName": "Concurrent Consumers", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Allows you to use multiple threads to poll the sqs queue to increase throughput" },
"defaultVisibilityTimeout": { "kind": "property", "displayName": "Default Visibility Timeout", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The default visibility timeout (in seconds)" },
"deleteAfterRead": { "kind": "property", "displayName": "Delete After Read", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Delete message from SQS after it has been read" },
- "deleteIfFiltered": { "kind": "property", "displayName": "Delete If Filtered", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through [...]
+ "deleteIfFiltered": { "kind": "property", "displayName": "Delete If Filtered", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with [...]
"extendMessageVisibility": { "kind": "property", "displayName": "Extend Message Visibility", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "If enabled then a scheduled background task will keep extending the message v [...]
"kmsDataKeyReusePeriodSeconds": { "kind": "property", "displayName": "Kms Data Key Reuse Period Seconds", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The length of time, in seconds, for which Amazon SQS can reuse a data key to [...]
"kmsMasterKeyId": { "kind": "property", "displayName": "Kms Master Key Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK." },
@@ -85,7 +85,7 @@
"concurrentConsumers": { "kind": "parameter", "displayName": "Concurrent Consumers", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Allows you to use multiple threads to poll the sqs queue to increase throughput" },
"defaultVisibilityTimeout": { "kind": "parameter", "displayName": "Default Visibility Timeout", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The default visibility timeout (in seconds)" },
"deleteAfterRead": { "kind": "parameter", "displayName": "Delete After Read", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Delete message from SQS after it has been read" },
- "deleteIfFiltered": { "kind": "parameter", "displayName": "Delete If Filtered", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": true, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get throug [...]
+ "deleteIfFiltered": { "kind": "parameter", "displayName": "Delete If Filtered", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with [...]
"extendMessageVisibility": { "kind": "parameter", "displayName": "Extend Message Visibility", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "If enabled then a scheduled background task will keep extending the message [...]
"kmsDataKeyReusePeriodSeconds": { "kind": "parameter", "displayName": "Kms Data Key Reuse Period Seconds", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The length of time, in seconds, for which Amazon SQS can reuse a data key to [...]
"kmsMasterKeyId": { "kind": "parameter", "displayName": "Kms Master Key Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK." },
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
index 4e5675c..e492ada 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
+++ b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
@@ -67,7 +67,7 @@ The AWS 2 Simple Queue Service (SQS) component supports 43 options, which are li
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -145,7 +145,7 @@ with the following path and query parameters:
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -321,7 +321,8 @@ of the route, use a Filter:
------------------------------------------------------------------------------------------------------
from("aws2-sqs://MyQueue?amazonSQSClient=#client&defaultVisibilityTimeout=5000&deleteIfFiltered=false&deleteAfterRead=false")
.filter("${header.login} == true")
-.to("mock:result");
+ .setProperty(Sqs2Constants.SQS_DELETE_FILTERED, constant(true))
+ .to("mock:filter");
------------------------------------------------------------------------------------------------------
In the above code, if an exchange doesn't have an appropriate header, it
@@ -329,6 +330,9 @@ will not make it through the filter AND also not be deleted from the SQS
queue. After 5000 milliseconds, the message will become visible to other
consumers.
+Note we must set the property `Sqs2Constants.SQS_DELETE_FILTERED` to `true` to
+instruct Camel to send the DeleteMessage, if being filtered.
+
== Available Producer Operations
- single message (default)
- sendBatchMessage
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
index 3ba8bb1..909c91f 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
@@ -60,7 +60,6 @@ public class Sqs2Configuration implements Cloneable {
@UriParam(label = "consumer", defaultValue = "true")
private boolean deleteAfterRead = true;
@UriParam(label = "consumer", defaultValue = "true")
- @Deprecated
private boolean deleteIfFiltered = true;
@UriParam(label = "consumer")
private Integer visibilityTimeout;
@@ -364,9 +363,8 @@ public class Sqs2Configuration implements Cloneable {
}
/**
- * Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If
- * 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send
- * DeleteMessage.
+ * Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key
+ * {@link Sqs2Constants#SQS_DELETE_FILTERED} (CamelAwsSqsDeleteFiltered) set to true.
*/
public void setDeleteIfFiltered(boolean deleteIfFiltered) {
this.deleteIfFiltered = deleteIfFiltered;
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
index 439e2ca..95faf15 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
@@ -30,4 +30,5 @@ public interface Sqs2Constants {
String MESSAGE_GROUP_ID_PROPERTY = "CamelAwsMessageGroupId";
String SQS_QUEUE_PREFIX = "CamelAwsSqsPrefix";
String SQS_OPERATION = "CamelAwsSqsOperation";
+ String SQS_DELETE_FILTERED = "CamelAwsSqsDeleteFiltered";
}
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
index 9d06355..3d24fa0 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Consumer.java
@@ -250,14 +250,14 @@ public class Sqs2Consumer extends ScheduledBatchPollingConsumer {
}
private boolean shouldDelete(Exchange exchange) {
- boolean shouldDeleteByFilter = exchange.getProperty(Exchange.FILTER_MATCHED) != null
+ boolean shouldDeleteByFilter = exchange.getProperty(Sqs2Constants.SQS_DELETE_FILTERED) != null
&& getConfiguration().isDeleteIfFiltered() && passedThroughFilter(exchange);
return getConfiguration().isDeleteAfterRead() || shouldDeleteByFilter;
}
private boolean passedThroughFilter(Exchange exchange) {
- return exchange.getProperty(Exchange.FILTER_MATCHED, false, Boolean.class);
+ return exchange.getProperty(Sqs2Constants.SQS_DELETE_FILTERED, false, Boolean.class);
}
/**
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SqsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SqsComponentBuilderFactory.java
index d4b219b..9436628 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SqsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2SqsComponentBuilderFactory.java
@@ -331,10 +331,9 @@ public interface Aws2SqsComponentBuilderFactory {
return this;
}
/**
- * Whether or not to send the DeleteMessage to the SQS queue if an
- * exchange fails to get through a filter. If 'false' and exchange does
- * not make it through a Camel filter upstream in the route, then don't
- * send DeleteMessage.
+ * Whether or not to send the DeleteMessage to the SQS queue if the
+ * exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED
+ * (CamelAwsSqsDeleteFiltered) set to true.
*
* The option is a: <code>boolean</code> type.
*
@@ -344,7 +343,6 @@ public interface Aws2SqsComponentBuilderFactory {
* @param deleteIfFiltered the value to set
* @return the dsl builder
*/
- @Deprecated
default Aws2SqsComponentBuilder deleteIfFiltered(
boolean deleteIfFiltered) {
doSetProperty("deleteIfFiltered", deleteIfFiltered);
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
index 7c8b0d7..e2c8bd9 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Sqs2EndpointBuilderFactory.java
@@ -523,10 +523,9 @@ public interface Sqs2EndpointBuilderFactory {
return this;
}
/**
- * Whether or not to send the DeleteMessage to the SQS queue if an
- * exchange fails to get through a filter. If 'false' and exchange does
- * not make it through a Camel filter upstream in the route, then don't
- * send DeleteMessage.
+ * Whether or not to send the DeleteMessage to the SQS queue if the
+ * exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED
+ * (CamelAwsSqsDeleteFiltered) set to true.
*
* The option is a: <code>boolean</code> type.
*
@@ -536,17 +535,15 @@ public interface Sqs2EndpointBuilderFactory {
* @param deleteIfFiltered the value to set
* @return the dsl builder
*/
- @Deprecated
default Sqs2EndpointConsumerBuilder deleteIfFiltered(
boolean deleteIfFiltered) {
doSetProperty("deleteIfFiltered", deleteIfFiltered);
return this;
}
/**
- * Whether or not to send the DeleteMessage to the SQS queue if an
- * exchange fails to get through a filter. If 'false' and exchange does
- * not make it through a Camel filter upstream in the route, then don't
- * send DeleteMessage.
+ * Whether or not to send the DeleteMessage to the SQS queue if the
+ * exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED
+ * (CamelAwsSqsDeleteFiltered) set to true.
*
* The option will be converted to a <code>boolean</code>
* type.
@@ -557,7 +554,6 @@ public interface Sqs2EndpointBuilderFactory {
* @param deleteIfFiltered the value to set
* @return the dsl builder
*/
- @Deprecated
default Sqs2EndpointConsumerBuilder deleteIfFiltered(
String deleteIfFiltered) {
doSetProperty("deleteIfFiltered", deleteIfFiltered);
diff --git a/docs/components/modules/ROOT/pages/aws2-sqs-component.adoc b/docs/components/modules/ROOT/pages/aws2-sqs-component.adoc
index 5b50203..571b0b7 100644
--- a/docs/components/modules/ROOT/pages/aws2-sqs-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-sqs-component.adoc
@@ -69,7 +69,7 @@ The AWS 2 Simple Queue Service (SQS) component supports 43 options, which are li
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -147,7 +147,7 @@ with the following path and query parameters:
| *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
| *defaultVisibilityTimeout* (consumer) | The default visibility timeout (in seconds) | | Integer
| *deleteAfterRead* (consumer) | Delete message from SQS after it has been read | true | boolean
-| *deleteIfFiltered* (consumer) | *Deprecated* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | true | boolean
+| *deleteIfFiltered* (consumer) | Whether or not to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS_DELETE_FILTERED (CamelAwsSqsDeleteFiltered) set to true. | true | boolean
| *extendMessageVisibility* (consumer) | If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs. | false | boolean
| *kmsDataKeyReusePeriodSeconds* (consumer) | The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). | | Integer
| *kmsMasterKeyId* (consumer) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. | | String
@@ -323,7 +323,8 @@ of the route, use a Filter:
------------------------------------------------------------------------------------------------------
from("aws2-sqs://MyQueue?amazonSQSClient=#client&defaultVisibilityTimeout=5000&deleteIfFiltered=false&deleteAfterRead=false")
.filter("${header.login} == true")
-.to("mock:result");
+ .setProperty(Sqs2Constants.SQS_DELETE_FILTERED, constant(true))
+ .to("mock:filter");
------------------------------------------------------------------------------------------------------
In the above code, if an exchange doesn't have an appropriate header, it
@@ -331,6 +332,9 @@ will not make it through the filter AND also not be deleted from the SQS
queue. After 5000 milliseconds, the message will become visible to other
consumers.
+Note we must set the property `Sqs2Constants.SQS_DELETE_FILTERED` to `true` to
+instruct Camel to send the DeleteMessage, if being filtered.
+
== Available Producer Operations
- single message (default)
- sendBatchMessage
diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_9.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_9.adoc
index 55658be..ecafd47 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_9.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_9.adoc
@@ -104,6 +104,12 @@ the one to use above, and then add which -starter JARs you want to use in your C
- Camel-AWS-S3 has been removed. Please switch to Camel-AWS2-S3.
- Camel-AWS-SWF has been removed. There won't be a replacement for it.
+=== camel-aws2-sqs
+
+The option `deleteIfFiltered` has been changed to use a different exchange property with key `Sqs2Constants.SQS_DELETE_FILTERED`
+which must be set. Beforehand a property by Filter EIP was being used, however this property has been removed due
+to optimizing core Camel.
+
=== Camel-Azure component
- Camel-Azure has been removed. Please switch to Camel-Azure-Storage-Blob and Camel-Azure-Storage-Queue.