You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Carlos Roman (JIRA)" <ji...@apache.org> on 2012/10/30 19:12:11 UTC

[jira] [Updated] (CAMEL-5761) Update SqsConsumer to extend Visibility Timeout correctly

     [ https://issues.apache.org/jira/browse/CAMEL-5761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Roman updated CAMEL-5761:
--------------------------------

    Attachment: aws_sqs_visibility_timeout_simple.patch
                aws_sqs_visibility_timeout_phased_timeout.patch

Two possible patches to solve the problem.
                
> Update SqsConsumer to extend Visibility Timeout correctly
> ---------------------------------------------------------
>
>                 Key: CAMEL-5761
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5761
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws
>    Affects Versions: 2.10.2
>            Reporter: Carlos Roman
>              Labels: aws, patch, sqs
>         Attachments: aws_sqs_visibility_timeout_phased_timeout.patch, aws_sqs_visibility_timeout_simple.patch
>
>
> Currently SqsConsumer will scheduled a future to happen start occruing 1/2 the visibility timeout, and reoccur again at the visibility timeout period. Because of the way SQS works, when you request a ChangeMessageVisibility timeout it does not add that to the time remaining on the message visibility. Instead it will set the message visibility to the time out given. This means that what actually happens in the camel code is that:
> * we request the ChangeMessageVisibility timeout to be set to X seconds from now after X/2 seconds
> * then every X seconds after that we we request the ChangeMessageVisibility timeout to be set to X from now
> This means that our message will become visible every now and again as the ChangeMessageVisibility timeout is not updated in time as period between successive executions is the same as the timeout period we request.
> I've attached two patches which would fix this issue.
> * "aws_sqs_visibility_timeout_simple.patch" - This patch changes the way we set up the future. The delay and period are now the same so that we call ChangeMessageVisibility every X/2 after the message has been pulled. 
> * "aws_sqs_visibility_timeout_phased_timeout.patch" - This one keeps the delay to 1/2 the period and requests ChangeMessageVisibility every period. This time though it requests the visibility to be 1.5 * the period. This means that it behaves as originally planned, as if it was adding duration to the visibility duration left. This means we call Amazon less times and still keep the message hidden as expected.
> This was looked at with Alex Hutter (both working on same project).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira