[ 
https://issues.apache.org/jira/browse/CAMEL-21550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17905972#comment-17905972
 ] 

Narsi Reddy Nallamilli commented on CAMEL-21550:
------------------------------------------------

I see it was change in this commit,
https://github.com/apache/camel/commit/9a29ad738c5514d1ea9dc8975b5ab353333eac21#diff-c85e8e2e10450ca6ea23878a310bcfa2901dbdd97e5616c1669f0b04a14fcc80L175

> camel-aws-sqs - message is getting expired before extended changes the 
> visibility before first trigger
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-21550
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21550
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws2-sqs
>            Reporter: Narsi Reddy Nallamilli
>            Priority: Major
>             Fix For: 4.10.0
>
>
> Issue: sqs extender scheduler initial start is set to queues visibility 
> timeout.  when the fifo queues in the application are couple of them, when 
> its more it causes this issue.
> {code:java}
> if (visibilityTimeout != null && visibilityTimeout > 0) {
>                 int delay = visibilityTimeout;
>                 int repeatSeconds = (int) (visibilityTimeout.doubleValue() * 
> 1.5);
>                 this.timeoutExtender = new TimeoutExtender(repeatSeconds);
>                 if (LOG.isDebugEnabled()) {
>                     LOG.debug(
>                             "Scheduled TimeoutExtender task to start after {} 
> delay, and run with {}/{} period/repeat (seconds)",
>                             delay, delay, repeatSeconds);
>                 }
>                 this.scheduledFuture
>                         = 
> scheduledExecutor.scheduleAtFixedRate(this.timeoutExtender, delay, delay, 
> TimeUnit.SECONDS);
>             }
> {code}
> E.g if the visibility is 10sec the extender would start around 10sec and by 
> the time the extender changes the visibility the message's visibility in the 
> queue would have expired and got removed. And since the extender uses the 
> expired message receipt handle sqs server return 
> ReceiptHandleIsInvalidException but because this exception is supressed sqs 
> client assumes it was successful.
> {code:java}
> try {
>                         LOG.trace("Extending visibility window by {} seconds 
> for request entries {}", repeatSeconds,
>                                 batchEntries);
>                         
> getEndpoint().getClient().changeMessageVisibilityBatch(request);
>                         LOG.debug("Extended visibility window for request 
> entries {}", batchEntries);
>                     } catch (MessageNotInflightException | 
> ReceiptHandleIsInvalidException e) {
>                         // Ignore.
>                     } catch (SqsException e) {
>                         if (e.getMessage()
>                                 .contains("Message does not exist or is not 
> available for visibility timeout change")) {
>                             // Ignore.
>                         } else {
>                             logException(e, batchEntries);
>                         }
>                     } catch (Exception e) {
>                         logException(e, batchEntries);
>                     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to