Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x bead1560c -> 3e1c3a62b


CAMEL-10340: Adjusted deleteIfFiltered behavior for aws-sqs component


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3e1c3a62
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3e1c3a62
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3e1c3a62

Branch: refs/heads/camel-2.16.x
Commit: 3e1c3a62b347c65e5fdcca1f540f0f44bb045605
Parents: bead156
Author: Mike Yan <[email protected]>
Authored: Fri Sep 30 19:13:44 2016 +0800
Committer: Andrea Cosentino <[email protected]>
Committed: Fri Sep 30 14:00:27 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/aws/sqs/SqsConsumer.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c3a62/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
----------------------------------------------------------------------
diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
index 72f3922..3533893 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java
@@ -226,10 +226,12 @@ public class SqsConsumer extends 
ScheduledBatchPollingConsumer {
     }
 
     private boolean shouldDelete(Exchange exchange) {
+        boolean shouldDeleteByFilter = 
exchange.getProperty(Exchange.FILTER_MATCHED) != null
+                && getConfiguration().isDeleteIfFiltered()
+                && passedThroughFilter(exchange);
+
         return getConfiguration().isDeleteAfterRead()
-                && (getConfiguration().isDeleteIfFiltered()
-                    || (!getConfiguration().isDeleteIfFiltered()
-                        && passedThroughFilter(exchange)));
+                || shouldDeleteByFilter;
     }
 
     private boolean passedThroughFilter(Exchange exchange) {

Reply via email to