camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Roman (JIRA)" <>
Subject [jira] [Updated] (CAMEL-5761) Update SqsConsumer to extend Visibility Timeout correctly
Date Tue, 30 Oct 2012 18:12:11 GMT


Carlos Roman updated CAMEL-5761:

    Attachment: aws_sqs_visibility_timeout_simple.patch

Two possible patches to solve the problem.
> Update SqsConsumer to extend Visibility Timeout correctly
> ---------------------------------------------------------
>                 Key: CAMEL-5761
>                 URL:
>             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:

View raw message